# Exclude reporter on First comment date

**URL:** <https://community.eazybi.com/t/exclude-reporter-on-first-comment-date/5998>\
**Category:** Questions & Answers\
**Tags:** javascript, jira\
**Created:** [January 22, 2021, 7:25am UTC](https://community.eazybi.com/t/exclude-reporter-on-first-comment-date/5998 "2021-01-22T07:25:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![allenmichael.santos](https://community.eazybi.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@allenmichael.santos](https://community.eazybi.com/u/allenmichael.santos)\
**Post date:** [January 22, 2021, 7:25am UTC](https://community.eazybi.com/t/exclude-reporter-on-first-comment-date/5998/1 "2021-01-22T07:25:00Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![daina.tupule](https://community.eazybi.com/user_avatar/community.eazybi.com/daina.tupule/32/8838_2.png) [@daina.tupule](https://community.eazybi.com/u/daina.tupule)\
**Post date:** [February 9, 2021, 8:31am UTC](https://community.eazybi.com/t/exclude-reporter-on-first-comment-date/5998/2 "2021-02-09T08:31:27Z")

</div>

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](https://docs.eazybi.com/eazybijira/data-import/custom-fields/advanced-settings-for-custom-fields) or ask Jira administrator or [eazyBI administrator](https://docs.eazybi.com/eazybijira/set-up-and-administer/set-up-and-administer-for-jira-server/additional-settings) 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](https://docs.eazybi.com/eazybijira/data-import/jira-issues-import#JiraIssuesImport-Editimportparameters)after changes in advanced settings and select the [custom field for import](https://docs.eazybi.com/eazybijira/data-import/jira-issues-import#JiraIssuesImport-JiraCustomFields) as property and measure (if needed). Run an import.

Daina / [support@eazybi.com](mailto:support@eazybi.com)
