All eazyBI for Jira eazyBI for Confluence Private eazyBI

Last comment
eazyBI for Jira

Import the body of the issue last comment (excluding automatically generated comments) and show results using the measure "Issue last comment text" with "Issue" dimension members at 'issue' level.

Account-specific calculated field

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

Settings for the new field

Internal name

lastcomment

Display nameLast Comment text
Data type

text 

Additional advanced settings
json_fields = ["comment"] #this line is mandatory

Custom JavaScript code:

if (issue.fields.comment && issue.fields.comment.comments) {
  for (i=issue.fields.comment.comments.length-1; i>=0; i--) {
    var commentItem = issue.fields.comment.comments[i];
    if(commentItem.author && commentItem.author.displayName && commentItem.author.displayName != "Automation for Jira") {
        return commentItem.body;
      break;
    }
  }
}

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_lastcomment]
name = "Last comment text"
data_type = "text"
json_fields = ["comment"]
javascript_code = '''
// Insert here the Custom JavaScript code
'''