JavaScript Calculated Custom Fields How create a connection with the time field

I want to let the “resolution interval” intersect with the Actual Solution Date field.Currently, the “resolution interval” filter is based on the creation date, What should I do to filter “resolution interval” based on the Actual Solution Date? Here is part of the eazyBI Settings code, please check it out!

#Actual Solution Date 
[jira.customfield_10719]
data_type = "datetime"
measure = true
#***********************   resolution interval   **************************
[jira.customfield_resolution_interval]
name = "cf resolution interval"
data_type = "integer"
dimension = true
measure = true
javascript_code = '''
if(issue.fields.customfield_10719) {
issue.fields.customfield_resolution_interval = 
  (Date.parse(issue.fields.customfield_10719) - Date.parse(issue.fields.customfield_10721)) / 1000 / 60 / 60 / 24; 
}
'''
time_unit = "days"
time_interval = "duration"
intervals = "0,7,14,28"
interval_unit = "days"

Hi @flashx,

It seems we had a conversation on the internal eazyBI support channel regarding the same topic. Therefore, I will post the provided answer below to help other community members facing the same problem.

I suppose you want to tie the number of issues by cf resolution interval dimension to a specific Time dimension period. If that is the case, I recommend using a different measure in the report. In eazyBI, measures are tied to the Time dimension by different dates. For example, the measure “Issues created” is tied by the issue creation date, “Issues resolved” by the issue resolution date, etc. To consider issues by the custom field “Actual Solution Date”, I recommend using the measure “Issues with actual solution date” in the report.

Please see our documentation page for more details on how measures and the Time dimension converge - Jira Core measures and dimensions.

Best,
Roberts // support@eazybi.com

1 Like

Thank you very much, :+1:this reply is completely valid! Although I have solved this problem, thank you for your team’s serious discussion and reply to me. Sincere best wishes

Kind regards
flashx