Changes Due date

I try to find issue with change Due date but i have some problems with this.
I try this code:

var previousDuedate = new Array();
if (issue.changelog && issue.changelog.histories) {
  for (var i=0; i < issue.changelog.histories.length; i++){
    var history = issue.changelog.histories[i];
    for (var a=0; a < history.items.length; a++) {
      var item = history.items[a];
      if (item.field == "Due Date" && item.from) {
        previousDuedate.push(item.from);
      }
    }
  }
}
if (previousDuedate) {
    return previousDuedate.join(",");
}

An in history of tickets i have: Due Date Original: 2023/01/01 New: 2023/02/01

Hi @Gavrila_Deaconu,

You can get due date changes with the JavaScript calcauted custom field if you have Jira Cloud. Unfortunately, a similar solution won’t work for the Jira Data Center (and Server).

Please see this community post for the complete code and how to apply it on the Cloud, as well as an alternative solution for the Data Center:

Best,
Zane / support@eazyBI.com