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 = true
dimension = true
javascript_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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Colt,
The division by 1000 in this code is needed to translate milliseconds of the timestamp to seconds. eazyBI stores the calculated seconds and use them for the interval calculation.
It is possible to configure in eazyBI the interval dimensions with different ranges. Please, check some examples of how to do that here: https://docs.eazybi.com/eazybi/analyze-and-visualize/interval-dimensions.
You might wish to check more examples on Javascript calculated custom fields in eazyBI: https://docs.eazybi.com/eazybi/data-import/data-from-jira/jira-custom-fields/javascript-calculated-custom-fields
Kindly,
Janis, eazyBI support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.