Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

When Transition - Update workflow and status

Alexandra Wiechers
Contributor
August 5, 2020

HI,

I have a post function (using ScriptRunner) to update assignee and some other custom fields.  It has the script to update the status as well.  However, I am then left in a bogus state (even if it's status is in the same workflow, which some are not).

My question - has anyone been successful with using ScriptRunner to update issue status with a Post Function.  If so, how?

I believe I need to set the workflow too but not seeing how to do that!  Help please!

1 answer

0 votes
Nic Brough -Adaptavist-
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.
August 5, 2020

No, you never update the status in a post-function.  To change the status of an issue, you use a transition.  Embedding a status change inside a transition can only have two effects - it corrupts the data the transition is working with, or it goes into a cascade with a possibility of an infinite recursion (i.e. it'll pause and then crash Jira)

Remove the code that is corrupting the status.  Step back and look at what you were trying to achieve.  (If you're stuck on how to do it, by all means, ask here)

Alexandra Wiechers
Contributor
August 6, 2020

Thanks Nic,

The team wants to be able to "Escalate" a ticket from one group to another.  While "Escalating", they want to update certain fields like Assignee, custom fields and the status (because the group they escalate too uses a different workflow).

I'm essentially trying to automate a "Move" using code and adding some changes to custom fields.  This is because the team does not want to have to do this themselves/manually (I know, I know).

I'm currently using a transition to "Escalate" to each different team (they have multiple) and in the transition I'm updating status (because it moves to a different Request Type which has a different workflow).

I don't know another way to do this any other way.  Is there a way to automate a "Move" and then I could script the other fields?

Appreciate any help!

Suggest an answer

Log in or Sign up to answer