Automation based on time tracking

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Create automation for time tracking which will send emails based on the threshold set in the condition.

Solution

Prerequisite for the rule :

  • Two fields to set the notification budget threshold value as per your requirement.

Rule logic :

  1. We will trigger the rule when the work log is entered in an issue.

  2. we will subtract the original estimate and remaining estimate and divide it by 28800 (/60/60/8) where 8 denotes the 8-hour work per day. This will give you the actual time spent on the case by the user.

  3. Now, we will calculate the threshold values: Here: 50% is /2 and 75% is calculated by /4*3

    • for 50% we will divide the original estimate value by 28800 and we will divide the result by 2

    • for 75% we will divide the original estimate value by 28800 and we will divide the result /4 with the result, we will multiply by 3.

  4. We will now add conditions to the calculations made in the above 2 steps.

    • if step2 value > step3 50% and step2 < step3 75% then we will update the field the notificaiton_50%_budget to YES and then send an email to the users.

    • if step2 value > step3 75% we will update the field notification_75%_budget to YES and send an email to users.

Rule creation steps :

Step 1:

Automation rule trigger "work logged"

Step 2:

Action → Create variable

Create a variable in automation to subtract remaining time from original estimate

smart value :

{{#=}}({{issue.fields.timetracking.originalEstimateSeconds}} - {{issue.fields.timetracking.remainingEstimateSeconds}}) / 28800 {{/}}

Step3:

Action → create variable :

Create automation variable to divide original time estimate with 28800

Smart value :

{{#=}}({{issue.fields.timetracking.originalEstimateSeconds}} / 28800) / 2 {{/}}

Step 4:

Action → Create variable

Smart value to divide original estimate by 28800 and then by 4

Smart value :

{{#=}}({{issue.fields.timetracking.originalEstimateSeconds}} / 28800) / 4 {{/}}

Step 5:

Action → create variable

Smart value to multiple another smart value by 3

Smart value :

{{#=}} {{seventy}}* 3 {{/}}

Step 6:

Condition if :

Automation condition to compare different variables

Step 7:

Action → Edit issue :

Edit issue automation rule component

Step 8:

Condition - Else

Advanced compare condition in automation

Step 9:

Condition - Else

Edit issue automation component to update custom field

Complete rule looks like the below

Automation rule to send email based on timetracking

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.