Using eazyBI I can easily create a histogram which bins the number of days it takes to resolve an issue and display as a histogram using the resolution interval member. I'd also like to do the same thing but counting the days from when an issue was created to when it entered a status before RESOLVED. Any suggestions on how to accomplish this?
Hi Dough,
The chart like this can be done by creating a Javascript custom field in eazyBI and building a new interval dimension on top of it. Please, find below advanced settings creating the custom field and the interval dimension. Note to adjust the Javascript code with your status name. Please, see the eazyBI documentation for more details on the Javascript custom fields here:
https://docs.eazybi.com/display/EAZYBIJIRA/JavaScript+calculated+custom+fields
[jira.customfield_time_till_status]name = "Duration till status"data_type = "decimal"measure = truedimension = truejavascript_code = '''var activestatus = "Done";var datefrom = Date.parse(issue.fields.created);var dateto = new Date;var accepted = false;issue.changelog.histories.forEach(function(history){ history.items.forEach(function(historyItem){ if (historyItem.field == "status") { statusto = historyItem.toString; if(statusto.equals(activestatus)) { accepted = true; dateto = Date.parse(history.created); } } }); });if(accepted) { issue.fields.customfield_time_till_status = (dateto - datefrom) / 1000; }'''time_unit = "seconds"time_interval = "duration"intervals = "/10"interval_unit = "days"
After the import of the custom field, you will see the new interval dimension created in the data cube and will be able to use it in your reports.
Best regards,Janis, eazyBI support
Hey Janis,
This is great! can i do multiple intervals? As this requires a Jira admin to add the advanced settings I am trying to do it once for as many scenarios as able.
Hi,
Sure, you can replicate the same code with different statuses to create interval dimensions for different statuses. The following things need to be considered when creating new interval dimensions:
1) Assign a new field ID for each field, e.g.
[jira.customfield_time_till_status_my_status]
2) Specify a new name:
name = "Duration till My Status"
3) The last line of Javascript code must assign the value to the new custom field ID:
issue.fields.customfield_time_till_status_my_status = (dateto - datefrom) / 1000;
Best regards,
Janis eazyBI support
Thank you Janis! Is it possible to make unique calculated members as well? Or will the original "XXXX" number determine how the new members are defined as well?
(dateto - datefrom) / XXXX
Thanks,
Colt
It looks like you're new here. Sign in or register to get started.