All eazyBI for Jira eazyBI for Confluence Private eazyBI

Count of Comments by Time
eazyBI for Jira

Calculated field to retrieve count of comments for each issue by Time periods. You can import this field as a measure.

Account-specific calculated field

Account specific calculated fields are defined in Source Data → Import options.

Settings for the new field

Internal name

cf_commentsbytime

Display nameCount of comments by time
Data type

integer 

Measures

Additional advanced settings

json_fields = ["comment"]
multiple_dates = true

Custom JavaScript code:

var allcomments = [];
//check comments for each issue
if (issue.fields.comment.comments && issue.fields.comment.comments.length>0) {
  for (j=0; j<issue.fields.comment.comments.length; j++) {
    //get date and author of each comment
      var commentdate = issue.fields.comment.comments[j].created;
      allcomments.push(commentdate.toString().substr(0,10) + ',1');
  }
}
//get the array of comments
return allcomments.join("\n");

Global calculated field

Global calculated fields are defined in eazyBI advanced settings.

Here are the settings for the new field definitions. You should insert the JavaScript (the code given above) below the line // Insert here the Custom JavaScript codeKeep the opening and closing quotation marks. ''', do not delete them.

[jira.customfield_cf_commentsbytime]
name = "Count of comments by time"
data_type = "integer"
measure = true
json_fields = ["comment"] #this line is mandatory
javascript_code = '''
  // Insert here the Custom JavaScript code
'''