How can I access the change history of an issue in Automation Rules?

Ben van den Berg
Contributor
July 30, 2023

I want to include the "historic changes" that users made to an issue in an email using a manual automation rule.

I just can't seem to figure out which smart value list to use.

Hopefully, one of you has done something similar before and can point me in the right direction. 

4 answers

1 accepted

0 votes
Answer accepted
Jehan Bhathena
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 30, 2023

Hi @Ben van den Berg ,

Didn't find a way to get this via a smart value or in simple human readable format. But you can try to use this API in the automation rule, and send the content from the response in the mail.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-changelog-get

Ben van den Berg
Contributor
July 31, 2023

Thank you for your response @Jehan Bhathena 

I also couldn't find a way, I hoped there was a way to use the {{changelog}} smart value set to provide it, instead of going the APIs route.

I don't build a solution external to Jira automation just for this purpose. 

Jehan Bhathena
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 31, 2023

Hey @Ben van den Berg ,

thanks for the update.

I understand that Jira's smart values don't have it all, but from a product's perspective I don't think a lot of users would want to pipe all the history into a Smart Value (would be a huge value to handle)

Think of the Jira API as an inbuilt extension to the Automation :-), it is your call to take though.

Will try to keep this thread update if I stumble across anything else similar to what you're trying.

---

From the other thread that you responded too "I want to build a rule to check if and how many times specific fields were changed in the past, and then send an email to the team leader to investigate and address it"

You can use the API to fetch all the history, and use match() to find the occurrences of the field and use size() to count the times it occured

Like Dancey Apple likes this
1 vote
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.
July 30, 2023

Hi @Ben van den Berg 

What problem are you trying to solve by doing this?  Knowing that may help the community to offer better solution approaches.

For example, if your audience for these emails are Jira users who want to follow issue changes, couldn't they review the issue history directly or just watch the issues?

If instead the audience are not Jira users, sending the history directly might be both "noisy" with details and confusing to non-Jira users.  So perhaps creating some summary reporting would be more helpful.

Kind regards,
Bill

Ben van den Berg
Contributor
July 31, 2023

Hi Bill,

Some fields in an issue are often changed back and forth multiple times, e.g. status, and assignee. I want to build a rule to check if and how many times specific fields were changed in the past, and then send an email to the team leader to investigate and address it.

If you know whether issue change history information is available in automation rules, then you please share it with the community.

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.
July 31, 2023

Thank you for clarifying the problem you are solving.

Before you implement something in a rule to measure this, have you discussed with the team why the assignee and status values appear to be changing frequently?  Often such symptoms are caused by process issues, and so a discussion may reduce / eliminate the need for the measurement.

 

Back to your question...I believe there is only one way to get the history using an automation rule at this time: the method @Jehan Bhathena described calling the REST API with a web request to get the change logs, and then parsing them.  However please note there is a maximum limit on the number of changelog entries that can be returned for an issue using this method.  Paging will be necessary beyond that limit.

If you want to try this, please review this how-to article for calling the Jira REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Another alternative is to maintain counters in custom fields and to increment them when your fields change.  Those custom fields would be reportable with issue filters, dashboards, and issue exports.  I would not recommend this, as it could clutter the number of custom fields.

And, another possibility is to investigate the Atlassian Marketplace to learn if one of the addon apps would help with such measurement.

Like # people like this
0 votes
KL August 9, 2024

I was on the hunt too and found this which was perfect! You may need to edit the field value of course from duedate to whatever field you're searching

Solved: Notify when the due date field changes (atlassian.com)

 

Old Value:  {{changelog.duedate.fromstring}}

New Value:  {{changelog.duedate.tostring}}

0 votes
karim -Atlassway-
Banned
February 6, 2024

Hi @Ben van den Berg As an alternative , you can try out Issue Change History for better reporting .

You can  analyze and export issue history, including transitions, comments, updated fields, work log edits, attachment changes, and other activities

 

deepactivity main page.png

Atlassway Team

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