Forums

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

Automation updates assignee based on how the issue transitions through the workflow

Rosalind Bird
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2025

Hello!

I would really like some help with an automation.

There are three steps in my workflow:

  1. Write
  2. Edit
  3. Approve

Each step is done by a separate person, and the people who do each step will be different for every separate workflow. I have created custom fields (people fields) for each person on the issue, eg:

  • Write: Alex Smith
  • Edit: Roger Smith
  • Approve: David Smith 

I would like to write an automation which does the following:

When I change the status from Write to Edit, the issue automatically gets assigned to whoever I've allocated the edit job to.

I have tried the following automations (which haven't worked):

FIRST TRY

When: Issue transitioned from Write to Edit

Then: Edit issue fields Assignee

  • Set: {{Edit.DisplayNAME}}

And: Re-fetch issue data

The rule has been validated, and has run but it's not updating the assignee field with the name of the person who is doing the edit stage.

SECOND TRY

 

When: Issue transitioned from Write to Edit

Then: Assign the issue to: {{Edit.DisplayNAME}}

And: Re-fetch issue data

Please help!!

4 answers

1 vote
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.
January 24, 2025

Hi @Rosalind Bird -- Welcome to the Atlassian Community!

First thing, smart values are name, spacing, and case-sensitive.  When an incorrect one is used, that evaluates to null, often failing to work as expected.

The smart value for the display name of a user is displayName, as in {{issue.myCustomPeopleField.displayName}}

You may also want to use the accountId attribute for issue assignment rather than the displayName: {{issue.myCustomPeopleField.accountId}}

 

Next, there are several ways to select the users from your custom fields for the various transitioned-to statuses:

Using one rule will reduce the chance of errors and make maintaining the rule easier.

 

Finally, can your issues ever transition backwards in the workflow, such as from Edit back to Write?  If so, please consider to whom the issue should be assigned when that happens.

 

Kind regards,
Bill

0 votes
Rosalind Bird
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2025

Thanks for the help everyone, I got there in the end :-). The answer was to edit issue and then do advanced options with the following code as shown below.

 

{
"fields": {
"assignee": { "id": "{{customfield_10057.accountId}}" }
}
}

0 votes
Gerusa Lobo _e-Core_
Atlassian Partner
January 24, 2025

Hi Rosalind Bird

 

I have two solutions:

1. Automation

Create an Automation, with a condition for each status, like that:

Captura de Tela 2025-01-24 às 12.21.28.png

The transition must be empty:

Captura de Tela 2025-01-24 às 12.20.19.png

The condition block should be if-else, and analyze the status:

Captura de Tela 2025-01-24 às 12.20.27.png

 

2. Post-Functions

Use a workflows post function in these transitions, setting the field assignee to correct person, like that:

Captura de Tela 2025-01-24 às 12.03.58.pngCaptura de Tela 2025-01-24 às 12.04.11.png

I hope help you.

0 votes
Vishal Biyani
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.
January 24, 2025

@Rosalind Bird 

When you are doing the issue transition, you have the option of adding a post function. The post function gives the option, to update one field value from another.

based on your problem statement, I suppose this will suite your use case.

 

if you want to go with automation, can you share screen shot of your automation log to see where the rule is failing? 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events