Calculating the number of comments

Hi,

Issue comments form Jira are not imported by default into eazyBI.

However, you could try using a Javascript code in your eazyBI advanced settings to define a custom field that will return the number of comments for an issue.

[jira.customfield_comments]
name = "Comments"
data_type = "integer"
measure = true
javascript_code = '''
if (issue.fields.comment && issue.fields.comment.comments ) {
	issue.fields.customfield_comments = issue.fields.comment.comments.length;
}
'''

Later you could import this custom field as a measure (via eazyBI import settings) that will create a new set of measures “Comments created”, “Comments resolved” etc. in your “Measures” dimension.

Then you could select the measure “Comments created” and it should return the total number of comments for an issue.

If you already have been using some add-on to calculate a custom field (which return the total number of comments) in Jira, you could simply try importing this custom field in eazyBI as a measure via eazyBI import settings (and avoid using Javascript in advanced settings).

That approach should return the total number of comments for each issue (regardless of which user commented)
Note that it will not return the number of comments that specific reporter made.

If you expect to calculate the number of comments per reporter, a different Javascript code should be used to calculate the number of comments each user made and then you should map this to “Reporter” dimension.

Kind regards,
Martins / eazyBI support

1 Like