Forums

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

Write an automated comment for multiple field value changes using {{fieldChange}}

Bill Bayer March 31, 2022

Hello, 

 

I am trying to write an automation that is triggered by a field value change for 4 fields, all date changes.

 

I'd like to add a comment to the issue displaying the changes made to the specific field. I was able to get this working in an automation using the {{field.Change}} smart value, but only when looking at one value. Is there a way to combine the smart values to look for the specific fields that changed? 

This is my current comment with smart values when looking for one field. 

 

The following dates have changed:

{{fieldChange.field}}

{{fieldChange.fromString}} to {{fieldChange.toString}}

 

How can the other field values be added to this? would it be, {{fieldChange.customfield_xxxxx.fromString}} to {{fieldChange.customfield_xxxx.toString}} 

 

 

2 answers

0 votes
Gabi G May 20, 2022

I've been trying to get this to work as well. {{fieldchange}} only seems to work for one change and not multiple, and I don't know how/if to {{changelog}} can identify multiple custom fields that have changed?

Could someone provide an example of how this can work in Jira Software?

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 20, 2022

Hi @Gabi G 

You are correct that {{fieldChange}} captures the first change and {{changelog}} is the list of changes, as described here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

You may reference your custom fields by name (or custom field ID) in changelog, and comparing to check if {{toString}} is non-null will indicate a change.

Kind regards,
Bill

Gabi G May 20, 2022

Thank you for the quick response. So I would have to write a separate changelog query for each custom field that has potentially changed?

Thank you!

0 votes
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.
March 31, 2022

Hi @Bill Bayer 

You have a couple of options on this need:

  • when multiple fields change, {{fieldChange}} is a list and can be processed as such with the iterator syntax
  • {{changelog}} also contains any possible changes, and so you could specifically reference your fields and ignore the ones which are null in the from/to values

There examples of both methods on this documentation page: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events