Worklog calculated fields
eazyBI for Jira
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 theworklog
object (which contains JSON representation of one worklog entry as in issue JSON representation). For example, eazyBI can access Worklog comments withworklog.comment
. - Assign the custom field value to
worklog.customfield_NAME
or usereturn
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 name | Worklog 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 code
. Keep 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 '''