Exclude reporter on First comment date

Hi,

I was working on a script to get the response time from ticket creation to time of first response from the assignee. I found this https://community.eazybi.com/t/creating-a-time-to-first-comment-date/2469 and it really help. But I found that it also triggers even if the response is from the reporter. How can I exclude the reporter response so I can get the correct response time or is there any other way to do this?

Thanks,
Allen

The shared calculation is quite simple there. We just pick the first comment and get the date. You can extend it by iterating through all comments until the comment author is not a reporter.

Here is an example definition for the field with a calculation.

#first comment by no reporter
[jira.customfield_firstcommentdate]
name = "First comment date"
data_type = "datetime"
javascript_code = '''
var commenta = new Array();
var allcomments = issue.fields.comment;
if (allcomments && allcomments.comments ) {
  var comments = issue.fields.comment.comments;
  for (var i = 0; i < comments.length; i++) {
    var comment = comments[i];
    if (comment.author.key != issue.fields.reporter.key) {
      issue.fields.customfield_firstcommentdate = comment.created;
      break;
    }
  }
}
'''
  1. Add the custom field definition to eazyBI advanced settings or ask Jira administrator or eazyBI administrator to do this for you. eazyBI advanced settings are common for all accounts and only Jira/eazyBI administrators have access to the settings.

  2. Open source data Jira import options for edit after changes in advanced settings and select the custom field for import as property and measure (if needed). Run an import.

Daina / support@eazybi.com