Creating a Time to First Response


I’m trying to create a “Time to first Response” measure that show the time from issue creation to the time of the first comment. In order to do this, I am attempting to leverage the difference between the issue created date and a custom field I am importing.

The custom field is generated in Advanced Settings with:

name = “First comment date”
data_type = “datetime”
javascript_code = ‘’’
var comments = issue.fields.comment.comments;
if (comments.length > 0) {
var comment = comments[0];
issue.fields.customfield_firstcommentdate = comment.created;
I then import the first comment date as a custom property.

In order to generate the “Time to First Response” measure, I use the following calculated measure:

Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateDiffDays([Issue].CurrentMember.get(‘Created at’),
[Issue].CurrentMember.get(‘First comment date’))

However, whenever I add the Time to First Response measure to a table, it doesn’t display any values.

Does anyone know where I might be going wrong, or if there is an easier way to do this?