Jira Automation, trigger fields changing, access to {{fieldChange}} for every field

Егоров Виктор
Contributor
March 23, 2021

I have an automation rule that triggers on fields change (2 fields). This rule have to prevent unauthorized field changing every of this fields (or both).

I have an action, that update this two fields values with {{fieldChange.fromString}}. 

I suppose that for every field there is own context of {{fieldChange}}, but actually it seems that variable {{fieldChange}} contains only first changed field value. As a result, when one field changes, both fields get the same value.

How to access in action to old value for every field independently?

 

2 answers

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 23, 2021

Hi @Егоров Виктор ,

I don't know if this helps or not, but this is what I use:

{{issue.key}}'s {{fieldChange.field}} field was updated from {{fieldChange.fromString}} to {{fieldChange.toString}} by {{initiator.displayName}}.

Elton Lau October 19, 2022

Hi John, your example does not work today

on an "Issue updated" trigger, while updating the "Description" field

 

It becomes

 XXX-NNN's field was updated from to by XXXX.

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

Hi @Elton Lau -- Welcome to the Atlassian Community!

Would you please post images of your complete rule and of the audit log details showing the execution?  That may provide some context for the community to offer suggestions.  Thanks!

Kind regards,
Bill

Elton Lau October 24, 2022

Screenshot 2022-10-25 at 9.08.19 AM.pngScreenshot 2022-10-25 at 9.08.28 AM.png

Elton Lau October 24, 2022

the fieldChange.field, fieldChange.fromString, fieldChange.toString, are all EMPTY STRING

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.
October 25, 2022

Thanks for that information.

When you look at the issue change history for TES-214 what was the change that triggered the rule?  I recall that some changes can trigger Issue Updated, but that they are not tracked in a manner which shows in the change history.

And, some context setting questions:

Are you using Jira Cloud or Jira Server/Data Center?

What type of project is this: company-managed, team-managed, etc.?

Elton Lau October 25, 2022
  1. I triggered it by changing the "Description"
  2. Jira Cloud
  3. It's a team-managed project
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.
October 26, 2022

Hi @Elton Lau 

I just reproduced your results with both company-managed and team-managed projects.  It appears something has changed for both {{changelog}} and {{fieldChange}} with the latter one now returning JSON...but which cannot be dereferenced by attribute name (e.g. fromString) unless you explicitly select a field (e.g. description)

I suggest working with your site admin to submit a support ticket for this symptom if you are on a paid Jira license: https://support.atlassian.com/contact/#/

When you hear back from them, please post what you learn to help the community.  Thanks!

Like John Funk likes this
0 votes
Johnny Hermann
Contributor
December 10, 2021

Have you checked out {{changelog}}?

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