JIRA - Display the History of a Customfield

by Garth Leavey on October 27, 2017

This requirement has come up a few times in the past couple of years.

I had to get information on the last update of a customfield.  I was hoping there was a builtin JQL query that would work but unfortunately there is not (at this time). To get the history of a custom field I created a SIL Script Custom Field with the following script to get the last update made to a date field:

JFieldChange[] changes = getFieldChanges(key, "customfield_10000");

JFieldChange latestChange = changes[0];
date newest = latestChange.changeDate;

for (JFieldChange change in changes) {
if (change.changeDate > newest) {
latestChange = change;
}
}
return latestChange;

Topics: SIL Script, JIRA, Power Scripts, Atlassian Solutions