You can use the rest service to update the field settings and global plugin settings.
GET Global Configs
settings from {baseUrl}/secure/jibrokMessageFieldsConfig!default.jspa
Get settings
URL: /rest/message-field/1.0/config/messageFieldsConfig
METHOD: GET
RESULT:
{ "timeout": 1000, "showDefaultMessage": true, "whenRunJavaScript": "AFTER_DEFAULT_MESSAGE" }
timeout: time in milliseconds
showDefaultMessage: true or false
whenRunJavaScript: "AFTER_DEFAULT_MESSAGE"
or "AFTER_SCRIPTRUNNER_OR_TIMEOUT"
UPDATE Global Configs
settings from {baseUrl}/secure/jibrokMessageFieldsConfig!default.jspa
Set settings
URL: /rest/message-field/1.0/config/messageFieldsConfig
METHOD: GET
BODY:
{ "timeout": 1000, "showDefaultMessage": true, "whenRunJavaScript": "AFTER_DEFAULT_MESSAGE" }
timeout: time in milliseconds
showDefaultMessage: true or false
whenRunJavaScript: "AFTER_DEFAULT_MESSAGE"
or "AFTER_SCRIPTRUNNER_OR_TIMEOUT"
GET Field Settings by field config id
How to get field config id?
Get Field settings
URL: /rest/message-field/1.0/config/fieldConfig/{fieldConfigId}
example: /rest/message-field/1.0/config/fieldConfig/10215
METHOD: GET
RESULT: null or
{ "fieldConfigId": 10215, "title": "TEST TITLE", "body": "TEST BODY", "messageType": "change", "statuses": [ "1", "3", "4", "5", "6" ], "asFlag": false, "viewVersion": "v1", "code": "", "contexts": [ "CREATE", "EDIT", "TRANSITION", "VIEW_ISSUE", "CREATE_SD", "VIEW_SD" ], "screens": [ "CREATE", "EDIT", "TRANSITION", "VIEW_ISSUE", "CREATE_SD", "VIEW_SD" ], "viewFor": "login", "groups": [ "jira-users" ], "showIsHasLinks": false, "linkTypes": [ 0 ], "link": "ALL", "linkedStatuses": [ "4" ] }
statuses: status ids as list if string
contexts: for javascript code
messageType: info, success, error, warning, change
asFlag: true or false
viewVersion: v1(standard), v2(big)
viewFor: login, all, anonymous
link: INWARD, OUTWARD, ALL
linkTypes: 0 - all, -1 - Sub-task - Parent, -2 - Systems (Epic links) or link type id
whenRunJavaScript: "AFTER_DEFAULT_MESSAGE" or "AFTER_SCRIPTRUNNER_OR_TIMEOUT"
UPDATE Field Settings by field config id
Set Field settings
URL: /rest/message-field/1.0/config/fieldConfig
METHOD: POST
BODY:
{ "fieldConfigId": 10215, "title": "TEST TITLE", "body": "TEST BODY", "messageType": "change", "statuses": [ "1", "3", "4", "5", "6" ], "asFlag": false, "viewVersion": "v1", "code": "", "contexts": [ "CREATE", "EDIT", "TRANSITION", "VIEW_ISSUE", "CREATE_SD", "VIEW_SD" ], "screens": [ "CREATE", "EDIT", "TRANSITION", "VIEW_ISSUE", "CREATE_SD", "VIEW_SD" ], "viewFor": "login", "groups": [ "jira-users" ], "showIsHasLinks": false, "linkTypes": [ 0 ], "link": "ALL", "linkedStatuses": [ "4" ] }
statuses: status ids as list if string
contexts: for javascript code
messageType: info, success, error, warning, change
asFlag: true or false
viewVersion: v1(standard), v2(big)
viewFor: login, all, anonymous
link: INWARD, OUTWARD, ALL
linkTypes: 0 - all, -1 - Sub-task - Parent, -2 - Systems (Epic links) or link type id
whenRunJavaScript: "AFTER_DEFAULT_MESSAGE" or "AFTER_SCRIPTRUNNER_OR_TIMEOUT"
0 Comments