Last active
September 13, 2020 12:50
-
-
Save JiBrok/1259e91b68b1475fd97941bf9420a16b to your computer and use it in GitHub Desktop.
Update message from ScriptRunner Behaviours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
messageType values: success, info, warning, error, 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" | |
} | |
*/ | |
def field = getFieldById("customfield_10000") | |
field.setFormValue("{\"title\":\"Test title\", \"body\":\"Test body\", \"messageType\":\"success\"}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonOutput | |
def field = getFieldById("customfield_10109") | |
def message = [:] | |
message << [messageType: "warning"] | |
message << [title: "Test title2"] | |
message << [body: "<a>Test body2</a>"] | |
message << [asFlag: false] | |
message << [jibrokMessageKey: true]//REQUIRED | |
field.setFormValue(JsonOutput.toJson(message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonOutput | |
def field = getFieldById("customfield_10000") | |
def message = [:] | |
message << [messageType: "warning"] | |
message << [title: "Test title2"] | |
message << [body: "<a>Test body2</a>"] | |
field.setFormValue(JsonOutput.toJson(message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def field = getFieldById("customfield_10000") | |
field.setFormValue(""" | |
MESSAGE1 <b>test</b><br> | |
MESSAGE2 <b>test</b> | |
""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment