All eazyBI for Jira eazyBI for Confluence Private eazyBI

Worklog calculated fields

If you store some structured information in worklog comments, also known as worklog description (for example, if the work is billable or non-billable, or if it is overtime), then you can use calculated worklog custom fields to extract this structured information as a separate dimension.

Define a calculated worklog field as a JavaScript calculated field, and in addition:

  • Specify worklog = true, which will indicate that it is a worklog custom field.
  • In javascript_code, use the worklog object (which contains JSON representation of one worklog entry as in issue JSON representation). For example, eazyBI can access Worklog comments with worklog.comment.
  • Assign the custom field value to worklog.customfield_NAME or use return  statement to return the value.


Here is an example of a Worklog Comment dimension that will import the worklog comments/description + id of a comment. You can use this dimension with the measure "Hours spent" to analyze and group logged hours by common worklog comments.

Account-specific calculated field

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

Settings for the new field

Internal name

wlcomment

Display nameWorklog Comment
Data type

string 

Dimension

Additional advanced settings
worklog = true

Custom JavaScript code:

 if (worklog.comment) {
  return worklog.comment+" ("+worklog.id+")";
}
else {
  return "(no comment)";
} 

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_wlcomment]
name = "Worklog Comment"
data_type = "string"
dimension = true
worklog = true
javascript_code = '''
// Insert here the Custom JavaScript code
'''