Count User interaction with Issue

Hi @Daniel_Luevano,

With eazyBI you can analyze change history that is visible to eazyBI app as well as comments. While eazyBI for Jira Cloud can access all history records with Rest API, the eazyBI for Jira Server version can access only limited part of history records (status transitions, changes in single-select standard fields imported in eazyBI, and logged hours).
You may check which JSON objects are visible to eazyBI in section import options, tab “Additional options” (JavaScript calculated custom fields).

Anyhow, you may import count of activities (change history and comments) visible to eazyBI using JavaScript calculated custom field.

  1. In advanced settings, add the definition of new JavaScript calculated measure “Activity history”. The script for Jira Cloud version might look like this:
[jira.customfield_activities]
name = "Activity History"
data_type = "integer"
measure = true
multiple_dimensions = ["Assignee","Time"]
javascript_code = '''
var activities = [];
//check history records for each issue
if (issue.changelog.histories && issue.changelog.histories.length > 0) {
  for (i=0; i<issue.changelog.histories.length; i++) {
    if (issue.changelog.histories[i].author && issue.changelog.histories[i].author.accountId) {
      //get date and author of each history record
      var activityDate = issue.changelog.histories[i].created;
      var activityAuthor = issue.changelog.histories[i].author.accountId;
      activities.push(activityAuthor + ',' + activityDate.toString().substr(0,10) + ',1');
    }
  }
}
//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++) {
    if (issue.fields.comment.comments[j].author && issue.fields.comment.comments[j].author.accountId) {
    //get date and author of each comment
      var activityDate = issue.fields.comment.comments[j].created;
      var activityAuthor = issue.fields.comment.comments[j].author.accountId;
      activities.push(activityAuthor + ',' + activityDate.toString().substr(0,10) + ',1');
    }
  }
}
//get the array of changelogs and comments
issue.fields.customfield_activities = activities.join("\n");
'''

Advanced settings and JavaScript code for the Jira Server version are similar. Use author.key instead of author.accountId to retrieve the author of the activity.

  1. Then import “Activity history” as a measure in eazyBI.

  2. In the reports, use “Activity history” together with dimension Time (when was activity) and Assignee (who made activity).

Best,
Zane / support@eazyBI.com

2 Likes