SelectStar Blog

JIRA - Display the History of a Customfield

Written by Garth Leavey | Oct 27, 2017 4:49:58 PM

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;