Forums

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

Can I pass the value of a variable in automation (Smart Value)?

Thomas Sawyer
Contributor
August 16, 2021

Can we pass smart values between automation rules? 

At a high level, my main actions are:

1. Create a bug

2. Set the priority of the linked story to BLOCKED

3. Revert back to the story's original priority after the bug is resolved. 

I set up steps 1 and 2 in one rule. 

I put the current priority of a story in a variable called CurrentPriority. I obtained this value by using: {{issue.priority.name}}

 What I want to do is use this variable to reset the priority of the story after the linked bug is resolved. 

Should I abandon trying to pass smart values? Should I try and combine step 3 as part of a larger IF/Else statement? The IF being when a bug is created and Else being when a bug is resolved? That way the smart value stays in the same automation rule. 

 

1 answer

1 accepted

0 votes
Answer accepted
Julia Foden
Contributor
August 17, 2021

Hi Thomas

I suggest that when you set the priority of the linked story to BLOCKED, that you store the current priority in a field on the story. This field does not need to be on the screen and it could be a text field or a select list. Then when the bug is resolved, your rule can set the linked story's priority according to the value of the field, and clear the field.

Thomas Sawyer
Contributor
August 17, 2021

That sounds reasonable, but how do we set the value of one field based on the value of another? I've only seen value passing via Smart Values. 

Julia Foden
Contributor
August 18, 2021

Hi Thomas

You can set one field based on the value of another either by a smart value such as {{issue.my_field}} ... Screenshot 2021-08-18 105456.png

 

... or by selecting 'Copy from . . .' and then you can choose which field you want to copy from. So in this case I'm copying the contents of Description into another field called Details 

 Screenshot 2021-08-18 173938.png

 

Now I've not used this for copying another field's value into Priority, or copying Priority into another field. I've only done it with custom fields. If you run into problems because it's Priority, you could always do it by an If-else. IF Priority = Critical then edit my_field to Critical ELSE IF Priority = High then edit my_field to High etc

Thomas Sawyer
Contributor
August 19, 2021

I'll give it a whirl thanks Julia!

Like Julia Foden likes this

Suggest an answer

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

Atlassian Community Events