I have a radio button custom field named "Incident Priority" with options: Priority 1, Priority 2, Priority 3, and Priority 4, wanting to create a new sub-task if the custom field is changed after issue creation. I have been attempting to do the following within Script Runner's built-in "Create a sub-task" script with no success:
changeItems.any { it.field == 'Incident Priority' && it.oldstring == "Priority 1" && it.newstring == "Priority 2" }
This post function is currently in the create transition, listed after "Re-index an issue to keep indexes in sync with the database" and before "Fire a Issue Created event that can be processed by the listeners". Unfortunately, using JIRA's default priority field is not an option for this project.
Any input is greatly appreciated.
Exactly as Andrew says. You want Admin -> Script Listeners -> Create a subtask.
Under "expand examples" there are, well, examples for checking for field changes.
So after the issue is created - then you want to see if the priority custom field value gets changed, if so then create a sub-task. If you use a post function script on the create transition then it will never listen for changes to the issues after creation. It sounds like you'd want a event listener to listen for issueUpdated events, if the custom field priority was updated, then create a sub-task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.