I am trying to create a DAU graph based on interactions with a project. I have the following in my advanced settings to get the total number of interactions per user but I am having trouble getting the number of users in the Activity History Measure.
[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++) {
//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++) {
//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");
'''
I am hoping to turn this into the number of unique users.