Hello All
I am trying to build a workflow in which an item goes to "Open" status after its created. But if one of the value in the create screen is true, it should go to "Pending Approval" status. Can I create two outbound transitions from the create step so that the work item can land in different statuses based on the value provided in the create screen?
e.g If environment = SYS, item should be go to Open status after is created
If environment = PROD, item should go to Pending Approval status after its created.
Community moderators have prevented the ability to post new answers.
Hi Rajesh,
Assuming your environment field is a single select then you can simply do this by adding in two Fast-track transition an issue Scripted Post Functions which are provided by the Script Runner plugin.
You can then place these post functions at the bottom of the list of the Create transition using the code below to set the conditions and then setting the correct transition to be executed in order to automatically transition the issue to the correct status.
// SYS Post Function Code cfValues["environment"]?.value == "SYS" // Prod Post Function Code cfValues["environment"]?.value == "Prod"
I hope this helps.
Many Thanks
Kristian
There are several ways to do this, one which is to add a Post-Function in your workflow's Create event named "Transition Issue" with Conditional execution parameters on what you want. You can also use the SR function called "Fast Track transition an issue" which can do the same thing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh
Without extending JIRA you can only have one destination state for a Create action. However, if you add one of the scripting plugins you can add a post-function to achieve your desired action. Just remember where to add the script in the ordering to make sure it is after the step where the issue is updated to the destination status or your script will have no action.
I hope this helps
Phill
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.