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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,293
Community Members
 
Community Events
184
Community Groups

Extract previous (latest) assignee from a ticket using smart value

Hi, I am figuring out how to retrieve the previous assignee from a ticket request.

 

The reason why I am doing this is to remove the assignee from the watcher list once that particular person is being moved out of the assignee. I am thinking of smart value implementing on an automation.

 

This is the automation that I have in mind but it does not work due to the invalid smart value.

remove watcher automation.PNG

 

3 answers

1 accepted

6 votes
Answer accepted
Bill Sheboy
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.
Jun 25, 2021

Hi @Vandyck Lai Kai Yong 

Have you tried using the change log to access this value?  For example, this would return the ID of the previous assignee, assuming you have the same trigger of field change on assignee:

{{changelog.assignee.from}}

Best regards,

Bill

Hey @Bill Sheboy 

 

This works perfectly, thank you so much.

Like Bill Sheboy likes this

Hey @Bill Sheboy any idea how to change this id into displayName :) because 
{{changelog.assignee.from.displayName}} is not working.

Bill Sheboy
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.
May 17, 2023

Hi @Janusz Bułakowski 

I believe you can only get the account id value from the change log for users, and so there are a couple of work-arounds to get the displayName:

  1. set that value to a user field (either an existing one or a custom field), re-fetch the issue, and then you can access the displayName from the updated field
  2. call the REST API from the rule with a web request action using the account id to get the other user fields.

Kind regards,
Bill

Slightly different answer to a similar question.

We wanted to get the previous assignee before automation changed it (as part of a workflow transition post action) to assignee "Automation by Jira" so we could set it back to the original. Here's the important details:

Create Variable {{oldAssigneeId}} with the smart value {{assignee.accountId}}
Edit Field (Assignee): {{oldAssigneeId}}

TL;DR To store and use assignee, you need to be using the unique Account ID of that user, and that is stored in the {{assignee.accountId}} smart value. Reference: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/

Hi @mario.lurig , I'm looking to revert an assignee to a previous assignee (could be one of several, not a constant value) upon the transition of an issue from one status to one of two statuses. Do you know if there's a way to change the smart value {{assignee.acountId}} to be dynamic and point to an assignee at a certain status in the workflow?

 

-Thanks,

Joe

Not that I'm aware of. There is the audit log, but I wasn't able to access the smartvalues from there well. 

Bill Sheboy
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.
Sep 12, 2022

Hi @Joe Harrington 

There isn't anything built-in to do that. 

If you are always going back to the prior assignee, you could save the prior assignee whenever it changes, in a custom field and use that value later to revert.  If your workflow allows multiple transitions, and you want to target one prior status (e.g. back to the person assigned when in "Build") you could save multiple values in multiple custom fields.

Kind regards,
Bill

Hi Bill,

 

We do allow multiple transitions, but the primary use case I was targeting was when an issue is being tested in QA and the status/column in Under Testing, when the QA tester moves it either to Done or to Rejected, then the original dev (most likely the one assigned when the issue was automatically transitioned from In Progress to Code Review via our integration with Azure DevOps and the related PR is created) would be automatically assigned.

 

Could you please elaborate on how to implement the custom field workaround for targeting prior assignees at a point in time? Would I just create a custom field "Original Dev" and save the assignee when the issue transitions automatically from In Progress to Ready for Testing, and then when the issue transitions from Under Testing to Rejected or Done then the Original Dev assignee is assigned?

Bill Sheboy
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.
Sep 14, 2022

Yes, you have explained it well: save the assignee you want to return to (when in the development status), and use that later to re-assign, as needed.

For example to do this as you describe, first work with your admin to create the "Original Dev" custom field as a single, user field.  Then in your rule...

  • trigger: transition to "Ready for Testing"
  • action: edit issue to set "Original Dev" to Assignee

Later, use that custom field to re-assign in another rule.

Like Joe Harrington likes this

FYI, this is now available.

Use the Assign issue action, select Another field value or comment, and then select Previous assignee:

Screenshot 2023-02-24 at 2.53.43 PM.png

Like mario.lurig likes this
1 vote
Marco Brundel
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.
Jun 25, 2021

Hi @Vandyck Lai Kai Yong 

In another community item ( https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-can-assign-previous-user-on-a-defined-issue-status/qaq-p/650912

I see Andreas mentioning the following smart value. 

 

{{issue.Previous Assignee}}

 

Does this work for you?

Regards. Marco

Hi @Marco Brundel 

 

It does not work but I came up with an idea is there any way for me to extract the assignee value from audit log in another automation and remove the watcher by running the "Remove assignee from watcher" automation?

 

Something like this, I want to retrieve the assignee value from this audit log to be used in the remove watcher block.

 

set previous assignee.PNG

 

Cheers,

Lai Kai Yong

Suggest an answer

Log in or Sign up to answer