Message field - Script Runner Behaviours

Script Runner Behaviours

Don't work for message type - "Show as is"

It doesn't work if you select the message type in the field settings message type - "Show as is"

Settings

{baseUrl}/secure/jibrokMessageFieldsConfig!default.jspa

or gg + “message field settings"

Scripts in behavior can be very complex and run "not instantly", but for a second or more. In order for the plugin(message field) to wait for the result of script, in the plugin settings must set a timeout for waiting for a response from ScripRunner. If the "behavior" execution time exceeds the timeout, the plugin will not be able to display the received message. If the script is not large, it is usually enough to wait around 1 second. The 1000ms timeout is also almost invisible to users. If you need to set a longer waiting time, there is an option to display the default message from the field settings while waiting for the behavior script to execute. When "behavior" completes its execution, the message will be replaced with a new one.

During this time, the "Message field" field will wait for the result of Script Runner execution. As soon as the result is received(before the timeout expires) the message will be updated immediately.

 

For example, you can set the message "Loading" in the field settings. It will be displayed until "behavior" is performed and the new message from script is set.

 

 

 

1. Hide field

def field = getFieldById("customfield_10000") field.setHidden(true)

2.1 Update message (only body)

In the field settings must be set "Title" or "Body" - (default value)

def field = getFieldById("customfield_10000") field.setFormValue(""" MESSAGE1 <b>test</b><br> MESSAGE2 <b>test</b> """)

2.2 Set message as JSON text

messageType values: successinfowarningerror, change (Type "Change" works only for "Show as flag - No" and Jira 8.4.0+), SIMPLE_VIEW

viewVersion: v1 (standard), v2 (big)

  • { "title": "Test title", "body": "test body", "messageType": "info", "asFlag": true, "viewVersion": "v1" }

2.3 Set message as JSON

In the field settings must be set "Title" or "Body" - (default value)

messageType values: successinfowarningerrorchange (Type "Change" works only for "Show as flag - No" and Jira 8.4.0+), SIMPLE_VIEW

viewVersion: v1 (standard), v2 (big)

Service Desk

For Message field v2.4.0+