Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to skip a particular post function while passing the transition programmatically?

Vineet Kumar April 23, 2015

i was able to write a scripted post function, which passes a transition of other sub tasks of the same parent issue, but the real problem is, Both the subask has this common transition and i have to put the same script on both the workflows, now while passing the transition from subtask A the same scripted post function is getting triggered in subtask B, so the program is ending in a infinite chain and what i want do is the script should pass the transition with all the post functions except the same scripted postfunction in other subtask. is there any way to do that?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
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.
April 24, 2015

The only way to do this is to write your postfunction so that it is aware of which situation it is in and exits before doing anything when you don't want to run it.

Vineet Kumar April 24, 2015

Thanks Nick, i just need a confirmation, i will better find some workaround, i have one more question. The method 'workflowTransitionUtil.setAction(int actionId)' takes Id as an argument, is there any way to pass the transition name, or can i get the transition id from the transition name? beacuse the two workflows have the same transition name but not the id.

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.
April 24, 2015

Ok, you've stumped me - I've never had to write code to do that, I've always known the transition ID. So I'm stuck. Sorry.

Steve Kling September 14, 2016

There's a couple plugins that do this so I know its possible, but we're provide a "Fail Action ID" that should redirect/fast-forward the transition to another status if there is an error encountered in the custom post-function during transition. 

I've got it built out but can't get past the standard "It seems that you have tried to perform a workflow operation that is not valid for the current state of this issue" error.  

0 votes
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.
April 24, 2015

I may have stumbled with the same issue but I need to understand your problem better. Can you provide screenshots on what you are trying to accomplish?

TAGS
AUG Leaders

Atlassian Community Events