Mutiple outbound transitions from Create

Rajesh Kumar Maduraiveeran November 24, 2015

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.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 24, 2015

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

1 vote
GabrielleJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2015

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.

1 vote
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 24, 2015

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

TAGS
AUG Leaders

Atlassian Community Events