How can assign previous user on a defined issue status?

Sebastián Delmastro October 5, 2017

I have a workflow based on the following status:

Testing --> Code Review --> Ready For Release

 

The assignation rule is this:

Testing is assigned to A

Code Review is assigned to B

Ready For Released is assigned to A (the user who test the issue)

 

I like to automate the assignation when issues are transitioned to "Ready For Released" based on who was the assignee on "Testing Status"

 

 

2 answers

2 accepted

2 votes
Answer accepted
andreas
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.
October 5, 2017

Hi Sebastián,

You should be able to do this simply with Automation for Jira's assign action. There's an option to select the previous assignee:

prvs-assignee.png

Cheers,
  Andreas

Dave Theodore [Coyote Creek Consulting]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2017

This only works when the assignee of the issue is in Code Review never changes.  It doesn't really take in to account things like the intended code reviewer taking a vacation and the issue being reassigned, etc.  Saving the user to a field ensures that the issue gets back to the right place, regardless of what happens to the issue when it is in code review. 

Like Bojana Vasic likes this
Sebastián Delmastro October 5, 2017

Good point there @Dave Theodore [Coyote Creek Consulting].

Having a "previous assigne" makes a more strong solution if reassignation on the "code review" status occurs.

Thanks @Dave Theodore [Coyote Creek Consulting] and @andreas for your responses.

andreas
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.
October 5, 2017

True - it depends I guess on the exact requirements and workflow.  Assigning to a member of a custom field is just as easy though with Automation for Jira:

previous-smart-assignee.png

 

Any user picker field would work.

You'd probably need two rules:

  • Rule 1 - Set Previous assignee:
    • Trigger: Issue transitioned
    • JQL condition: status = "Code Review"
    • Action: Edit issue - set 'Previous Assignee' to the issue assignee
  • Rule 2 - Assign to previous assignee
    • Trigger: issue transitioned
    • JQL condition: status = "Ready for Release"
    • Action: Assign issue with {{issue.Previous Assignee}} (shown above)

Cheers,
Andreas

Sebastián Delmastro October 5, 2017

@andreas I used the {{issue.Previous Assignee}} but is not working. When the issue is transitioned to "Ready for Release" it is assigned to "Unassigned", not to the previous Assignee.

Looking at the smartfields on confluence config https://codebarrel.atlassian.net/wiki/spaces/AUTO4J/pages/27656216/Smart+Fields i could not find the {{issue.Previous Assignee}} definition.

Any other Smart Fields config documentation i am missing?

Thanks!

 

Bojana Vasic November 15, 2019

Hi @Dave Theodore [Coyote Creek Consulting] ,

Hope it is not to late to pop a question in this tread ;) 

Have a question regarding your comment: "This only works when the assignee of the issue is in Code Review never changes.  It doesn't really take in to account things like the intended code reviewer taking a vacation and the issue being reassigned, etc.  Saving the user to a field ensures that the issue gets back to the right place, regardless of what happens to the issue when it is in code review. "

Could you explain why you see this as a problem, since ticket will be assigned back to the Assignee A not to the one who was assignee during Code Review? But if we think that Assignee A is maybe away from work when ticket is assigned back to him on "Ready For Released", then we might have a problem anyway.... Are you further suggesting that the best way would be to have a custom field called e.g. Owner where we would save user and then assignee it back to that person, but that person can be away too...?

Many thanks!

Like Susanne Viljanen likes this
Dave Theodore [Coyote Creek Consulting]
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 15, 2019

This is somewhat situation dependent. In the original post, Sebastián had 2 users, the developer and the code reviewer.  The request was to have a way to automatically assign the issue back to the original developer after code review completed. The only reliable way to do this is to capture the original assignee in a field, then use that field to  assign the issue back.  Using the "last assignee" method works if those two users are the only ones involved, but in real life, this doesn't always happen.  There are a variety of reasons why the issue might be assigned to some other user or multiple users.  If you capture the original assignee in a field, you always get back to that person when you move the issue to "Ready for Release" (as in the original example.) 

Consider this example:

Developer completes the code changes and tosses it over the fence to CodeReviewer1. CodeReviewer1 looks at the code and realizes that he needs to have someone else look at the code, so he assigns it to CodeReviewer2. CodeReviewer2 is going on vacation and doesn't have time to thoroughly look through the code, so she assigns it to CodeReviewer3. CodeReviewer3 completes the review and moves the issue to "Ready for Release." By using the method of assigning back to the previous assignee, the issue would be assigned to CodeReviewer2.  If Developer was captured in a custom field, the issue would be assigned back to Developer.  Make sense?

Bojana Vasic November 27, 2019

@Dave Theodore [Coyote Creek Consulting] ,

Yes, it makes sense! :) Many thanks for clarifying, I am with you!

Kind Regards,

Bojana

  

1 vote
Answer accepted
Dave Theodore [Coyote Creek Consulting]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2017
  1. Install Misc Workflow Extensions app (Sorry, not free)
  2. Create a custom field called "Previous Assignee"
  3. Create a "Update Issue Custom Field" Post Function on the transition that goes between Testing and Code Review that populates the Previous Assignee field with %%CURRENT_USER%%
  4. Create a "Copy Value From Other Field" Post Function on the transition from Code Review to Ready For Release and set the "Source Field" to "Previous Assignee" and the "Destination Field" to "Assignee." Leave "Copy within same issue" selected.
  5. Enjoy the magic of post functions.
Sebastián Delmastro October 5, 2017

Thanks @Dave Theodore [Coyote Creek Consulting] for the workaround.

Creating "Previous Assignee" field might do the trick with Jira Automation. I am reticent to by 2 workflows solutions right now. Nevertheless i will have a look at JMWE.

Thanks!

Like Bojana Vasic likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events