Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,990
Community Members
 
Community Events
168
Community Groups

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

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

0 votes
Answer accepted
John Funk Community Leader Jun 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. 

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 Jun 18, 2020

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

@Murfy , 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 Jul 08, 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. 

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

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

Annotation 2020-07-09 175350.jpg

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?

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

Thanks, @Mathew Sommers 

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

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.

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 Sep 29, 2020

@Simmo  - Any thoughts here? 

Simmo Atlassian Team Sep 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

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

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?

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

Atlassian Community Events