'Time to first response’ / exclude attachments/reporter comments being counted as first comments

Hi eazyBI Support/Community

My first writing here, please bare with me :wink:

I have created ‘Time to first comment’ custom field according to this post in the community: Creating a Time to First Comment date.

So far so good…

The issue I’m now experiencing is that whenever a new ticket is opened and the reporter adds an attachment, the attachment is apparently added by the system after the ticket has been opened and JIRA is counting that as the first comment.

Since we’re monitoring this ‘Time to first comment’ custom field for SLA measurement the metrics obviously gets quite skewed.

Would you know a way to either exclude attachments from counting as a comment, or how to exclude the reporters comments from being counted as first comments?

Appreciate any thoughts and/or tips,

Best regards,

Caj

Hi @dodge365
Welcome to the eazyBI community.

You could try a slightly different version of Javascript to find the first comment added by user who is not also a reporter of the issue.

[jira.customfield_firstcommentdate]
name = "First comment date"
data_type = "date"
javascript_code = '''
if (issue.fields.comment && issue.fields.comment.comments 
    && issue.fields.comment.comments.length > 0) {
  var commentsarray = issue.fields.comment.comments;
  for (var i = 0; i < commentsarray.length; i++) {
    var commenthist = commentsarray[i];
    if (commenthist.author && 
        commenthist.author.key != issue.fields.reporter.key) {     
          var admincomment = commenthist.created.substr(0, 10);
          break;
        }
  }
  issue.fields.customfield_firstcommentdate = admincomment;
}
'''

Note that changing the Javascript for an already imported custom field would require double imports (one import without field selected, second with field selected again) to reset the code

Martins / eazyBI

Thanks for the solution @martins.vanags

Best regards,
Caj

Hi, this is Constanze.
I have a similar task:
We also want to retrieve the ‘Time to first Response’ from the comment field (date and time), if certain employees submit a comment.
This timestamp should be visible in a dashboard or a corresponding report.
Challenge: We cannot use a custom field.
Is there still a way to realize this with eazy.BI?
Would be great if you could help me with that.
Best regards,
Co

Hi @Co225

Please explain more about this requirement.
What timestamp are you looking for? Is it the timestamp from the very first comment (made by the first user), or is it the first timestamp for each user who made the comment?
Could you please share an example of how such a report would look like when it is built (which dimensions in rows, page filters, columns, etc)?

Martins / eazyBI