Can I use CHANGELOG to show changed values in an automation email?

Mathew Sommers June 15, 2020

Have an automation that is triggered when a value is changed (FixVersions) and have an email sent that includes the new changed value, want to also add the previous value ... here is what I go so far .. but doesn't work:

 

Changed to: {{triggerissue.fixVersions.name}} <-- this works
Changed from: {{changelog.fixVersions.fromString}} <-- this does not work

 

Have tried a few different combinations of .name.fromstring and others without success.  Any help appreciated.

3 answers

1 accepted

1 vote
Answer accepted
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.
June 15, 2020

Hi Mathew,

This is what I use for a field change:

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

It fires when the field is updated so I assume it will work for fixVersions also. 

Mathew Sommers June 18, 2020

Thanks!  This worked (mostly.)  Only limitation I found testing it was if I add more than one fixVersion then it returns empty, but in our situation it is generally 1:1 change and not multiple versions, so it should work most of the time.

 

Thanks!!!

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.
June 18, 2020

Great! Glad it is at least mostly working for you.  :-)

Raji July 8, 2020

@[deleted] , I tried using your suggestion, for a rule triggered by change of Fix Version. It works well for everything, but {{fieldChange.fromString}}. It displays a blank for this. However, it works fine with {{fieldChange.toString}}

I tried the exact same solution where I have the trigger based on change if other fields like 'assignee'; where it works well for both fromString and toString. Any thoughts on why it does not work for FixVersion?

My trigger condition pasted below

FixVersion trigger.jpg

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.
July 8, 2020

Hi Raji,

Are you sure there was an existing value for the Fix Version for that issue before it was updated? The fromString would be blank if there was no value. In other words, you edited the field to add a new Version when there was no value already in the field. 

Raji July 9, 2020

Hi @John Funk 

Yes, I had an existing value on the Fix Version/s

Here is my scenario and rule setup ; I had FixVersion as v1.1 on a JIRA Story PRO-100, and I edited the Fix Version/s to v1.2. The goal is to add a comment on the story when fix version changes. In my example, the rule got triggered and the output was as below

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

resulted in adding below comment

PRO-100's Fix Version field was updated from to v1.2 by Raji Joseph

whereas, I was expecting it to be

PRO-100's Fix Version field was updated from v1.1 to v1.2 by Raji Joseph

as you see, the output of {{fieldChange.fromString}}, came out as blank

Snapshot of the complete rule pasted below

FixVersion change rule.jpg

Mathew Sommers July 9, 2020

Here is what I wrote for ours and it works and should get you some ideas.

Annotation 2020-07-09 175350.jpg

Raji July 9, 2020

Mathew, thanks for your response. I tried replicating the smart values examples that you shared above, and still getting a blank for the 'fromString' 

Could you share your trigger condition pls

Also, in your use case, how are you editing the fixversion? Manually, right?

Mathew Sommers July 10, 2020

I manually change.  Clicking in the Fix Version field and selected the new Fix Version.

 

Here is the trigger.

Annotation 2020-07-10 114312.jpg

Raji July 10, 2020

Thanks, @Mathew Sommers 

Looks to be similar to the trigger condition I posted above. But, does not work for me

1 vote
OlehK August 24, 2022

Hi, @Mathew Sommers. I don't know if you found a solution, but I have found one.

We can see the following example in the docs {{#changelog.fixVersion}}{{toString}},

Screenshot from docs

Screenshot from 2022-08-25 01-40-12.png

but it isn't correct, because in the changelog the fixVersion field is called 'Fix Version'

Screenshot from Jira Automation log:Screenshot from 2022-08-25 01-13-56.png

So, if you want to get all fixVersion changes from #changelog please use

{{#changelog.Fix Version}}{{toString}} instead of {{#changelog.fixVersion}}{{toString}}

Result of execution:

Screenshot from 2022-08-25 01-25-20.png


In your case it should be {{changelog.Fix Version.fromString}} instead of {{changelog.fixVersions.fromString}}

I hope you'll find it useful.

Kalyan Sattaluri
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 9, 2023

Hey, thanks for digging in and catching the right syntax. Really Helpful!! 

0 votes
Šarūnas Meižikas September 29, 2020

Has anyone been able to solve this scenario?

We usually use multiple fix versions for each task, when you change value completely - no issues, you get alert 'old - xxx, new - yyy'. But when you simply add another value, then instead of getting 'old - xxx, new - xxx, yyy', old value is shown as empty.

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.
September 29, 2020

@Simmo  - Any thoughts here? 

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 29, 2020

Hey @John Funk ,

Multi value fields and value change is a bit of a tricky one. We've got:

https://codebarrel.atlassian.net/browse/AUT-2013 and https://jira.atlassian.com/browse/JRACLOUD-74953

The issue here is the way that the changelog treats the value change we get two entries I think. One for the old value and one for the new value. So we get the latest entry and have the new value but not the old. Its something like that. Bit of a known issue that requires quite a rework.

Hope that helps!

Cheers,

Simeon.

Like John Funk likes this
Mathew Sommers September 30, 2020

I was able to solve this issue with a small work around.  They way I did it was to create a hidden field that when the FixVersion changes, I copy the changed value into it ... the next time it changes, I pull from that value as the 'old value' and then after reporting, update the value.  Screen shot shows the rule and the resultant email screen shots.

Screenshot 2020-09-30 065706.jpg

Like John Funk likes this
Rahul Jith August 29, 2022

Hi @Mathew Sommers 

Hope you are doing well

 

Is this working still?

I am still getting blank with from and to strings. any advice to sort the issue?

Rahul Jith August 29, 2022
Rahul Jith August 30, 2022

Hi @OlehK 

Hope you doing good!

 

Can you show your complete code with the automation rule. I have tried with replacing fixVersions to Fix version and it still failed. Also tried with the details shared and it's still not working.

 

If you can share the complete code it will be helpful.

My requirement is any changes to fix version should be notified with old version details and new version details. 

Suggest an answer

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

Atlassian Community Events