Tracking changes in Due date

Hello

Can eazbi count the number of issues in which due date has been changed? And if so, then how do i do it?

Hi,

Import of Due date field changes does not come out-of-box.
However, there is one workaround you may want to try.

If you use the eazyBI add-on for Jira Server, you could create a new Jira MISC calculated custom field (in Jira using free add-on) that can be defined and imported in eazyBI.

Please read about one of the use-cases here:
https://docs.eazybi.com/eazybijira/data-import/data-from-jira-and-apps/jira-misc-custom-fields#JiraMiscCustomFields-Previousduedates

Also, there could be a workaround where you import all the due date field changes as a separate measure in eazyBI and then use in reports to find the counter of due-date field change per Time.

For more details on this approach you may want to reach out to eazyBI support

Martins / eazyBI support

Hi

I created a new Jira MISC custom field “Date of transition / time of the field”, but this is not displayed in issue.
Can you help me?

Hi,

In this case, you should define your new calculated custom field via eazyBI advanced settings.

After, that you should be able to see your custom field in the custom field list where you can select it and then import in eazyBI as the property for an issue.

Please find our documentation page - how to import Jira MISC custom fields
https://docs.eazybi.com/display/EAZYBIJIRA/Jira+Misc+Custom+Fields

Martins / eazyBI support

1 Like

thanks, all worked well)

1 Like

Hi Martin.

I found in the documentation the possibility of using javascript.
https://docs.eazybi.com/eazybijira/data-import/custom-fields/javascript-calculated-custom-fields.
Is it possible to get the same with javascript?

Hi Marat,

It would be possible to calculate changes of due date with Javascript only when eazyBI is used for Jira Cloud.

Martins / eazyBI support.

Hi Martin

I would like to know the javascript for the same for jira cloud

Hi @Ramesh_Mashetty1

You could try this code in Site settings (aka advanced settings) on eazyBI for Jira cloud app:

[jira.customfield_duedate_changes]
name = "Number of Due date changes"
data_type = "integer"
measure = true
javascript_code = '''
var duedateChanges = 0;
var events = '';
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {

  var histories = issue.changelog.histories;
  for (var i = 0; i < histories.length; i++) {
    var history = histories[i];
    if (history.items && history.items.length > 0) {
      for (var n = 0; n < history.items.length; n++) {
        var item = history.items[n];
        events = events + item.field + ';'
        if (item.field == 'duedate' && item.from) {
          duedateChanges++;
        }
      }
    }
  }
}
issue.fields.customfield_duedate_changes = duedateChanges;
'''

Next, open your eazyBI import options and select to import your new custom field as measures.
It should create a new measure that you can use together with other dimensions now.

Bon Apetit!

Hi Martins,
I am easyBI server user and I need tracking of Due Date changes. Can you support me with implementing your proposal:
“Also, there could be a workaround where you import all the due date field changes as a separate measure in eazyBI and then use in reports to find the counter of due-date field change per Time.”
or give me a hint how is that report posible in Jira server version
Many thanks in advance

@Anelia
Please check this script example:
https://docs.eazybi.com/eazybijira/data-import/data-from-jira-and-apps/jira-calculated-and-scripted-custom-fields#Jiracalculatedandscriptedcustomfields-Duedatechanges
When using scripted fields you can import changes for Due date field and use in eazyBI report

Martins / eazyBI team

Hi Martins and thanks for your answer.

I have a problem also that in the moment we are in Frozen zone for implementation of new fields, so it will be unfortunately no option.

I have already in parallel to Due date one custom field “Last due date”, which is basically taking the value von Due date, after it was changed. Field is imported in EasyBI (with Issue history option), so I was wondering if there is a way to show in my Report issues, which have

  • Last due date not empty

  • Last due date updated last week

I made JQL Filter for this:

type in (Topic) AND issueFunction not in issueFieldMatch(“project = Topics”, “Last Due Date”, due) AND “Last Due Date” is not EMPTY AND updatedDate >= -7d

Thank you for your support

@Anelia

If you have imported “Last due date” as property and measure, you could use that to create new user-defined calculated measures.

  1. here you would simply select a measure “Issues with Last due date” and it will count issues with the last due date.

  2. create a new calculated measure using this code:

(
[Time].[Week].CurrentDateMember.PrevMember,
[Measures].[Issues with last due date]
)

Martins / eazyBI

Many thanks Marins,
it works

Hi @martins.vanags ,

I have implemented previous Javascript measures with great success however this one gives the following error:

Execution of custom JavaScript code raised the following error:
description;components;environment;status;Workflow;description;description;issuelinks;Workflow;Workflow;priority;issuetype;Parent;assignee;resolution;status;fixVersions;assignee;

Do you have any advice for resolving this?

Thanks in advance

@YunesE

Which Javascript exactly are you talking about?

Martins / eazyBI

[jira.customfield_duedate_changes]
name = "Number of Due date changes"
data_type = "integer"
measure = true
javascript_code = '''
var duedateChanges = 0;
var events = '';
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {

  var histories = issue.changelog.histories;
  for (var i = 0; i < histories.length; i++) {
    var history = histories[i];
    if (history.items && history.items.length > 0) {
      for (var n = 0; n < history.items.length; n++) {
        var item = history.items[n];
        events = events + item.field + ';'
        if (item.field == 'duedate' && item.from) {
          duedateChanges++;
        }
      }
    }
  }
}
throw events;
issue.fields.customfield_duedate_changes = duedateChanges;
'''

@YunesE

The Javascript code had one unnecessary line “throw events” which I already removed from my post earlier in this thread.

Martins / eazyBI

Hi Martin,

I have a custom filed SVT_Due_Date which i used with your Java script to import it as a measure on my JIRA Cloud version. I was able to achive this but the table is empty.

[jira.customfield_duedate_changes]
name = “SVT_Due_DateChanges”
data_type = “integer”
measure = true
javascript_code = ‘’’
var SVT_Due_DateChanges = 0;
var events = ‘’;
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {

var histories = issue.changelog.histories;
for (var i = 0; i < histories.length; i++) {
var history = histories[i];
if (history.items && history.items.length > 0) {
for (var n = 0; n < history.items.length; n++) {
var item = history.items[n];
events = events + item.field + ‘;’
if (item.field == ‘SVT_Due_Date’ && item.from) {
SVT_Due_DateChanges++;
}
}
}
}
}
issue.fields.customfield_SVT_Due_Date_changes = SVT_Due_DateChanges;
‘’’

image

@Joshua

If you import your custom field as a property (as the measure “Issue SVT_Due_DateChanges” indicate) you would need to select the “Issue” dimension members at issue level in your report (see picture below).

Try importing the field as measures and select the measure “SVT_Due_DateChanges created” from the “Measures” section.
That would sum the value of SVT_Due_DateChanges field for the issues that are used for the dimension members which you select in your report rows currently.

Martins / eazyBI