Can't access issue history through {{changelog}} in Automation for Jira (Cloud)

Luiz-F Ferreira January 29, 2021

Hi to all!

I'm trying to keep track and correct some [Custom Fields] that somehow failed to update through an Automation trigger.

Those [Custom Fields] are dateTime types and refer to log a transition "Timestamp" for third-party integration purposes.

 

If I access the Issue page and change from "comments" to "history", I can see the timestamps I need to use, but on trying to retrive this informations through Automation using the smart field {{changelog}}, it returns only with the last change made, acting exactly like a {{FieldChange}.

 

I've seen some solutions using the JIRA REST API, and they use a flag "expand" that allows the whole history to be retrived. (https://community.atlassian.com/t5/Jira-questions/Is-it-possible-to-get-the-issue-history-using-the-REST-API/qaq-p/510094, for example)

Have I misunderstood the purpose from {{changelog}} smart value? Am I missing a configuration? Is it unavailable for Cloud or is a known Issue on automation? (maybe related to https://community.atlassian.com/t5/Jira-Software-questions/Automation-How-to-print-changelog-for-Smart-values-like-quot/qaq-p/1444186 ? )

I'm new to Jira and still digging my way to knowledge

 

Thanks in advance!

1 answer

1 accepted

2 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 29, 2021

Hi Luiz, I did some testing, and it looks like {{changelog}} only pertains to the changes made in the triggering action. Otherwise calls to {{changelog}} come up empty.

To test this, I tried looking at {{changelog}} via a manually triggered rule, and I kept getting nothing. When I finally switched the trigger to be "Field value changed", that's when I saw the value get populated. 

Bottom line: you won't be able to use {{changelog}} to dig through the history of an issue. They really should make that clearer in the documentation.

You're right about the API though. I was successfully able to view full history by making this call:

https://SERVER/rest/api/3/issue/HELP-17?expand=changelog

So then maybe you could write a script external to Jira to iterate through your tickets and find the data you need.

I'd recommend looking at CLI which provides a nice way to make REST calls and extract info out of the responses and then feed them to CLI commands that could set values.

Luiz-F Ferreira January 29, 2021

Hi Darryl!

Thanks for the fast reply, I ended up with that same conclusion during my tests, but I can't connect through an API, though! I have to configure it, and ask for the right permissions as I'm not a system admin!

About the {{changelog}} smart value, to me it should be, theoretically, the same type of smart value as the API, right?

But maybe the root of my confusion is:

The way it behaves now, bringing only the "triggered history data", what are the differences between {{changelog}} and {{fieldchange}}? are there any difference?

Because I fell they shouldn't have the exactly same behavior...

 

[Sorry if I made too many mistakes, I hope I made my question clear! :D english is not my mother-tongue]

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 29, 2021

Hey @Luiz-F Ferreira -- If you try it from a web browser from you're already logged into Jira, you shouldn't need any additional permissions. Just try substituting your hostname and issue key and it should work for any issue you can see.

It should work great, for testing.

If you end up writing a script though, you should generate and use an API Token.

I agree though that a Smart Value named "changelog" really ought to give you access to the whole changelog, not just the most recent change.

Re: {{changelog}} and {{fieldChange}}

I guess the difference between {{changelog}} and {{fieldChange}} is that changelog lets you look at changes to a specific field, where as {{fieldChange}} lets you "access the value of a field that has changed" (without needing to know what it is).

Of course, that seems less useful because of this:

When there are multiple fields that have changed, {{fieldChange}} only contains the first changed value.

Like # people like this

Suggest an answer

Log in or Sign up to answer