Forums

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

How to automatically change the assignee when transitioning the workflow

Michael Ellis July 25, 2019

I need to change the assignee when transitioning through the workflow.  But if the review of the doc in each part of the workflow was to fail, I need to assign it back to the person who last reviewed/changed it.  I know using a post-function I can change the assignee as it moves forward but if it moves backward then how do I assign the issue back to the last person who had it.  I do not want to assign to the Reporter who was the person who originally created it. 

1 answer

1 accepted

0 votes
Answer accepted
Pete Singleton
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.
July 25, 2019

You could do this by:

  1. Create a new custom field for 'Previous Assignee'.  It doesn't have to be added to the screens if you don't want it seen.
  2. On transition, copy the Assignee to the Previous Assignee field, and assign to the new individual.
  3. On transition back, copy Previous Assignee back to Assignee.
Michael Ellis July 25, 2019

That sounds good but looks like you would have to use something like Script Runner to make it happen.

Pete Singleton
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.
July 26, 2019

You can do it with the Jira Misc Workflow Extensions addon

Max Foerster - K15t
Community Champion
July 26, 2019

You don't even need a new custom field for this (Yay! Clean instance!). With a groovy script in ScriptRunner / Jira Misc Workflow Extensions or the expression parser (a function called previousValue() or fieldHistory()) in Jira Workflow Toolbox you can access historic values of a field. I would prefer that as long as you can make sure assigning issues only happens for a reason and a controlled manner. Then it's pretty easy. :)

Best, Max

David Fischer
Community Champion
July 26, 2019

You can also use JMCF's "Transition Author" custom field type to automatically capture the last author of a transition (such as "Review"), and then copy from that field to the Assignee field when you want to reassign to the last reviewer. The advantage is that this field will work on existing issues, unlike if you create a normal field and fill it during the transition.

Like Max Foerster - K15t likes this
Max Foerster - K15t
Community Champion
July 26, 2019

Edit: Forget what I wrote. That went horribly wrong. :D

Michael Ellis July 26, 2019

Decided to go with using Jira Misc Workflow Extensions, have it working now.  Thanks for all the good ideas.  I also added script runner encase I need it later.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events