Two workflow transitions in a sequence

Sandeep Kumar February 9, 2014

Hi All,

I am developing a custom workflow in JIRA and I have a requirement where I have 2 transitions in a sequence and would like your opinion on the same

Status 1>>Approval 1 >>Approval 2 >>Status 2

Do I need to add the 2nd transition as a sub-task.

Thank in advance

SKumar

2 answers

0 votes
Sandeep Kumar February 9, 2014

Thank you Nic

As per your suggesstion, I am going with Option-II but I still have one issue where I would like to route my task to different transition based on a field value.

e.g. Transition 1 [Condition 1, 2 & 3]

If Condition 1

then go to Transition 11

If Condition 2

then go to Transition 22

If Condition 3

then go to Transition 33

I am think about doing it using conditions & post functions but would appreciate if you can give me some pointers to achive this efficiently.

Thanks

SKumar

Udo Brand
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.
February 9, 2014

You won't need postfunctions, simply add to your three transitions the conditions.

add condition 1 to transition 11

add condition 2 to transition 22

add condition 3 to transition 33

If the condition is not met you won't be able to do this transition.

0 votes
Nic Brough -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.
February 9, 2014

I'm not sure there's an opinion to volunteer here, but I think it's because I am not understanding your requirements.

Transitions are functions of the workflow, they are not issues, so "add the 2nd transition as a subtask" is nonsense. I'm not sure why you've mentioned subtasks at all. Could you explain

Secondly, no, a transition has a fixed endpoint, which has a status. For the "sequence" you give, you can only do two things:

Status 1 >> Approval 1 >> Status 42 >> Approval 2 >> Status 2

or

Status 1>> Approval 1 >>Status 2

Sandeep Kumar February 9, 2014

Thank you Nic

As per your suggesstion, I am going with Option-II but I still have one issue where I would like to route my task to different transition based on a field value.

e.g. Transition 1 [Condition 1, 2 & 3]

If Condition 1

then go to Transition 11

If Condition 2

then go to Transition 22

If Condition 3

then go to Transition 33

I am think about doing it using conditions & post functions but would appreciate if you can give me some pointers to achive this efficiently.

Thanks

SKumar

Nic Brough -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.
February 9, 2014

Conditions STOP a transition, they don't change the end point. What you could do is have conditions that look at your field and say "if field set to A, only show transition 1", "if B, only show 2" and so-on. BUT, that only works for current data, it will NOT work if the user changes the data during the transition (because the conditions run BEFORE you get to the transition)

Changing the end point of a transition has been suggested as something to do in a post-function. So far, it has NEVER worked in any sane way that doesn't destroy your data.

The way to do it is with a listener. Have

Status 1 >> Approval 1 >> Status 42 >> Approval 2 >> Status 2

Then find/write a listener that catches event "approval 1" and if your field is set, issues ANOTHER transitition from "42" to "2"

Sandeep Kumar February 10, 2014

Thank you Nic for your reply

I would not be able to set the custom field value before the transition. It will be set during the transition and based the custom field value, the next transition should be decided.

Example:

e.g. Transition 1 - depends on the custom field value

If Condition 1

then go to Transition 11

If Condition 2

then go to Transition 22

If Condition 3

then go to Transition 33

I am looking for some plug-ins which can provide me the above functionality.

Another thing I can do it using Groovy Script Runner to get the custom filed value and then decide the next transition based on the value.

Thanks

SKumar

Nic Brough -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.
February 10, 2014

I already read the example and explained that you can not do it that way.

Please re-read my answer, and previous comment. You need a listener.

Suggest an answer

Log in or Sign up to answer