Report to get the due date change history in an issue type

How to generate report in EazyBi based on how many time a due date has been changed in an issue type.

Say i have an issue type, defect and the defect would be set with a due date and a fix version. But the due date changes due to some dependency. In this case how can i list all the issues with the history of the due date change.

Currently, only able to get the current due date set, not the history of it.

1 Like

Hi @njp

Welcome to the Community :tada:

There are two ways how to approach this depending on your platform:

  1. Only for eazyBI for Jira Cloud
    You can define a new Javascript calculated custom field that will return all the due dates of the Issue and then count the number of due dates in the report: JavaScript calculated custom fields

  2. For eazyBI for Jira Server or Data center You can use scripted fields in Jira to get the values. You can read more here: Showing Issues with due dates changes for EasyBi Jira server version

​Best regards,
​Nauris / eazyBI support

Thank you, If we add the javascript custom field then would it affect all the data and all the accounts?
What are the expected issues that might come up after this settings update?

Hi @njp

Only for eazyBI for Jira Cloud:
If you add the code to the global Advanced settings, then there will be an additional custom field available for selection in all your accounts. Nothing will change in the accounts until you select to import this new custom field into all of them.

You can add a new calculated field that will be available only to this one account.

In this case, you can create the field with the following settings:

The JavaScript code adjusted for the new calculated field:

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 == "duedate" && item.from) {
        previousDuedate.push(item.from);
      }
    }
  }
}
if (previousDuedate) {
    return previousDuedate.join(",");
}

Save the field, select it to be imported as a property, and start the import.

After the import finishes, a property “Issue Previous Due dates” should be available in the Measures dimension that will return the due dates for individual issues in the Rows section.

​Let me know if this fits your use case or if you have any additional questions on this!
​Best regards,
​Nauris

We are using version 6.6.0.
So, i was able to add a new calculated field as mentioned in the new calculated field technote.
Post import i get the new property and custom field
image
But when i user the property, in the measures it shows a blank column for all the issues even though few issues has changed the due dates multiple times.

Hi @njp

My apologies. I completely missed the fact that this approach only works for eazyBI for Jira Cloud.

For eazyBI for Server/Data center, please use the approach described here: Showing Issues with due dates changes for EasyBi Jira server version

I’ll fix my previous replies accordingly so that others will not be misled.

Again, my apologies for the confusion!

​Best regards,
​Nauris

Thanks Nauris for the information!

So for the sever i should add the script in the same new calculated field section as mentioned in the previous comment?

@nauris.malitis any thoughts or information on my previous comment/query?

HI There, I’m trying to use the provided code but when I add to the Jira Advanced settings screen, the code gets reformatted with red strikethrough. Suggestions?
image

Hi @Ann

Welcome to the Community! :tada:

There are two ways how to create this field in eazyBI:

  1. Define an account-specific custom field like it’s done above. Then the given code will work as expected.
    or
  1. Define a global calculated field. You’re already in the correct place to do it- Advnaced settings. However, you’ll need to add some more parameters to define the field:
[jira.customfield_prevdd]
name = "Previous Due dates"
data_type = "text"
javascript_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 == "duedate" && item.from) {
        previousDuedate.push(item.from);
      }
    }
  }
}
if (previousDuedate) {
    return previousDuedate.join(",");
}
'''

Let me know if this works as expected!
​Best regards,
​Nauris

HI There - Yes, I did get the code to work as a account-specific custom field. Thank you for the additional parameters to use the code as a global calculated fields. Regards, Ann

1 Like

HI There,
So I tried to add the code to Advanced settings for a global calculated field which resulted in a 500 error. Our organization already had code in advanced settings for a custom hierarchy. Now the code for the custom hierarchy no longer works without the added code you’ve provided. Help Please
Regards, Ann

Hierarchy code:
[jira.plans]
enable = true

[jira.customfield_11200]
hierarchy_levels = [
{name = “OKR”, issue_type = “OKR”},
{name = “Epic”, issue_type = [“Epic”]},
{name = “Feature”, issue_type = [“Feature”]},
{name = “Parent”},
{name = “Sub-task”}
]