Forums

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

Automation rule to update a custom field with value of field that was just updated

Lorraine Gorman
Contributor
December 7, 2022

Trying to create a rule to update a custom field triggered by a field value change of another custom field value change.  The difficulty seems to arise in using changed field value as part of the updated field value.

For ex, when value changes for Field A ( i.e. custom field 10000)  I want to use this value as part of the value in the updated field (i.e. then populate custom field 20000 using that value).

So I have this in the Advanced field edit.  If I use any other custom field on the issue, this syntax works.  Only when I use the value of the field that just changed does it not work.  Is there some way I need to reference the same field on the issue that just changed in the trigger?

{
"fields": {
"customField_20000": "https://www/tools/casesystem/case/{{issue.customField_10000.value}}"

}
}

Thanks for your help in advance.

1 answer

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.
December 7, 2022

Hi @Lorraine Gorman 

What is the trigger for your rule?

If I assume it is Field Value Changed or Issue Updated, you could use the {{changelog}} entry for the field and {{toString}} as described here:  https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

Kind regards,
Bill

Lorraine Gorman
Contributor
December 9, 2022

Hi @Bill Sheboy -- thanks for responding to my question.  I struggle with smart values, JSON, etc., looks promising - I will try changelog.  Yes, the field value changed is what I'm using for the trigger and it's the custom field I want to use to populate the other custom field.  Just quick question, it looks like the changelog properties are limited to Summary, Issuetype and Status.  Can I use it on other fields/ properties (my field is a custom field)?  It says these are the available properties

  • {{changelog.summary}} - Changelog information for the Summary field
  • {{changelog.issuetype}} - Changelog information for the Issue type field.
  • {{changelog.status}} - Changelog information for the Status field.

 

Regardless, I will take a look, thanks for the pointer.  I'll post after some attempts and let you know if I can get it to work. 

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.
December 9, 2022

Hi, Lorraine!

If a field is supported by rules, it most likely is supported by changelog also.  I recommend trying your field to see what happens.

And...smart values are name, spacing, and case-sensitive, so if you are in doubt of the smart value for your custom field, please use this how-to article to confirm the name and if it is supported by rules: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Like # people like this

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