Filtering comments from Worklogs

Hello Folks,

I have created a dimension to be able to visualize worklog comments, I followed this documentation and it worked perfectly : JavaScript calculated custom fields (eazybi.com)

However, I want to be able to aggregate this comment by the words used inside the comments. To be able to see how much time was spent on work logged for this tasks ( for example : ceremonies, meetings, daily → these would be the 3 categories I would like aggregate the worklog comment with.

Do you by any chance know how to do that ?

I tried to aggregate, however i dont want to aggregrate by a specific comment, i want to aggregate by the words used inside the comments.

Thank you :slight_smile:

Hi @sikimimi,

Thanks for posting your question!

You can use the following JavaScript in eazyBI advanced settings:

[jira.customfield_wlcomment_category]
name = "Worklog Comment Category"
data_type = "string"
dimension = true
worklog = true
javascript_code = '''
if (worklog.comment) {
  if (worklog.comment.includes("meetings")) {
    return "A";
  } else if (worklog.comment.includes("ceremonies")) {
    return "B";
  } else if (worklog.comment.includes("daily")) {
    return "C";
  } else {
    return "Other"; 
  }
} else {
  return "(no comment)";
}

After updating the settings, you will need to import the data and you will see a new dimension created in eazyBI (Worklog Comment Category).

In my example below you can see that Issue MNO-20 has comments containing all three keywords and is therefore returned in all 3 categories:

You can read more about JavaScript calculated custom fields in our documentation here: JavaScript calculated custom fields

I hope this helps!

Best,
Marita // support@eazybi.com