How-To Enable Reporting on Worklog (Workaround)

In this post, we tackle a common challenge faced by many Atlassian Analytics users: effectively reporting on the Worklog data from Jira.

How-To Enable Reporting on Worklog (Workaround)
AI Generated Image using DALL-E

In our latest video tutorial (video will be uploaded soon!), we tackle a common challenge faced by many Atlassian Analytics users: effectively reporting on the Worklog data from Jira.

ℹ️
This blog will be updated soon to include (1) the relevant video, and (2) additional information on additional use cases - and how to link the Worklog information with addition tables (system and custom) to get more of Atlassian Analytics.

While Worklog data are not explicitly loaded into the Atlassian Analytics schema, in this blog, we will share a workaround that allows you to report on Time Spent on specific Jira issue.

⚠️
Notes on the workaround - you won't be able to extract the details of the user that the Logged Work was logged against; instead, you will be able to get the details of the user who edited the issue with the work log data. Also the entered "Date started" in the "Time Tracking" entry is not accessible, instead the only date value is "when the entry" was registered!
📽️
Full video for a comprehensive walkthrough and additional insights - COMING SOON!

Step 1: Create a Custom Table in Atlassian Analytics

To begin extracting the Worklog data, we first create a custom table that calculates each Time Spent entry in the data source into its own row. This approach allows for easier aggregation, filtering and analysis, as each Time Spent is treated as an individual entry.

Create a new custom table named 'view_LoggedWork' - using the SQL query below:

SELECT `Jira Issue History`.`issue_id` AS `Issue Id`,
       (IFNULL(REPLACE(`Jira Issue History`.`value`, 's', ''), 0) - IFNULL(REPLACE(`Jira Issue History`.`prev_value`, 's', ''), 0)) AS `Logged Work`,
       `Jira Issue History`.`started_at` AS `Logged At`,
       `Jira Issue History`.`author_account_id` AS `Account Id`
FROM `jira_issue_history` AS `Jira Issue History`
LEFT OUTER JOIN `account` AS `Account` ON `Jira Issue History`.`author_account_id` = `Account`.`account_id`
WHERE (`Jira Issue History`.`field_name` = 'Time Spent')

Create Custom Table: "view_LoggedWork"

ℹ️
The above query returns the 'Logged Work' in seconds - you can convert it to minutes, hours or days by dividing 60, 3600, or 28,800 respectively (1 day = 8 hours in Jira).

Ensure that the new custom table integrates smoothly with the existing data structure by linking it to the primary tables using appropriate SQL JOINs

Left Outer Join - Issue Id
Left Outer Join - Account Id

Step 3: Test

Finally, we test our new structure by creating a chart in the visual SQL editor. This step confirms the effectiveness of our setup and showcases the ease of applying filters and creating interactive dashboards.

  • Start by selecting from the Issue table the 'Issue Key', and from the 'view_LoggedWork' table the 'Logged Work', and from the Account table the 'Name' field.
  • Adding conditions to filter where 'Logged Work' is not null and 'Project Key' = {Your Project Key}.
  • Check the Join Path: This helps confirm that the 'view_LoggedWork' is correctly linked to the Issue and Account tables.
Join Path

Final Thoughts

With the workaround above, you can create dashboards and reports on the work logged against Jira issues in specific time periods, and can also aggregate based on hierarchy.

As mentioned above, the main limitation is that the Logged Work will be associated with the user that performed the "Log Work" action on the Jira issue and the date/time when the entry was made.