How to get total time logged into an issue using Automation for Jira

Still need help?

The Atlassian Community is here for you.

Ask the community

This article requires fixes

This article has been Flagged for fixing. Use caution when using it and fix it if you have Publisher rights.


 

Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

  

Summary


This article details steps to get the total time that is logged into a Jira issue via Automation for Jira. This action can be of benefit for Jira admins who would like to track the total time that is logged an issue's worklog, E.g: To send a notification when the total time logged into an issue exceeds a certain amount.


Environment

Jira Work Management, Jira Software, Jira Service Management

Scenario

The admin would like to send an email notification to a user (E.g: Team Lead, reporter) when the work logged into a Jira issue exceeds x amount of time.

Solution

Create an automation as below:

  • Pick 'Work Logged' trigger (Or any trigger depending on when/where you would like this rule to be triggered)
  • Then, add an Advanced Compare Condition. T he total amount of time logged into the issue that triggers this rule can be achieved using the following smart value:
    {{triggerIssue.worklog.timeSpentSeconds.sum}}

    For more options that can be used for the work log smart value, please refer here : Worklog Smart Values

  • Put the above smart value into the 'First value' and then the desired condition. Do note that the retrieved value from the smart value is in seconds, so do make sure the value to compare the time to is set in seconds. (E.g: To compare if the time logged into the issue has exceeded 4 hours, the 'second value' has to be set as 14400 (14400 seconds is 4 hours))
  • Add an action that occurs if the condition is successful. E.g: Add a comment to the issue, send an email notification
  • Save and publish the automation rule.


Last modified on Mar 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.