Hi , I want to replicate this graphic
but instead of using creation date, I want to use a resolution that counts from “In Progress” date until the issue is resolved.
I tried using this customization but it did not work
How to customize “age interval” - Questions & Answers - eazyBI Community
Hi @Cesar_Daldosso
The Community post that you’ve linked has an example for a custom age interval for unresolved issues.
For a custom resolution interval you would need something like the second example from the " Custom calculated field as an interval dimension" section in this documentation page: JavaScript calculated custom fields
A code like this should do the trick:
[jira.customfield_inprointerval]
name = "In Progress Resolved interval"
data_type = "decimal"
dimension = true
javascript_code = '''
var progressStarted = false;
if(issue.fields.resolutiondate) {
for (var i=0; i < issue.changelog.histories.length; i++){
issue.changelog.histories[i].items.forEach(function(item){
if (item.field == "status" && item.toString == "In Progress"){
issue.fields.customfield_inprointerval = (Date.parse(issue.fields.resolutiondate) - Date.parse(issue.changelog.histories[i].created)) / 1000 / 60 / 60 / 24;
progressStarted = true;
};
});
if (progressStarted) break;
}
}
'''
time_unit = "days"
time_interval = "duration"
intervals = "/10"
interval_unit = "days"
Best regards,
Nauris
Thank you, this issue has been resolved!!
1 Like