How can I find the value written to a custom field at the end of each sprint?

Hi,

Your guide was perfect.
My report is going to shine thanks to you.

I made one change that I thought I’d share.
When I tried the script in the link, it gave me different values for the last sprint I changed.
So I changed the script to the following and it worked fine.

dateChangeStrings = [];
whenDateChanged = issue.fields.created; //.toString().substr(0,10);
newDateChange = null;
duedateAsTimeChangeStamp = null;
histSet = {};
issue.changelog.histories.forEach(function (history) {
  history.items.forEach(function (historyItem) {
      if (historyItem.field == "Test Date") {
         newDateChange = historyItem.from;
         if (newDateChange) {
             duedateAsTimeChangeStamp = Date.parse(newDateChange);
             strNewDate = whenDateChanged.toString().substr(0, 10);
             
             histSet[strNewDate] = strNewDate + ',' + duedateAsTimeChangeStamp / 1000;
          
      }
         whenDateChanged = history.created;
       
    }
     
  });
});
if (issue.fields.customfield_10602) {
    strNewDate = whenDateChanged.toString().substr(0, 10);
    histSet[strNewDate] = strNewDate + ',' + Date.parse(issue.fields.customfield_10602) / 1000;
}
 
for (var histDate in histSet) {
    dateChangeStrings.push(histSet[histDate]);
}
 
dateChangeStrings = dateChangeStrings.sort();
 
issue.fields.customfield_test_date_history = dateChangeStrings.join("\n");

Once again, thanks for your help.

2 Likes