Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

I want to sum up 'Time logged' against sub-tasks, and update it in the 'Time logged' of the parent

Edited

Hi,

I have been trying to use automation rule in Jira to sum the time-logged against any/every sub-tasks and then add it to the Parent User story's "Time logged".

It seems that the automation rule recognizes the 'Time log' field when I use it as a trigger, but when I want to save the value to it, it just doesn't allow me to find the 'Time logged' field.

Just to be clear, I don't mean the Original estimate or the Remaining estimate fields.

Scenario example:
1. User story : A
                         - Tasks # 1 (1 hour work logged i.e. Time spent = 1)

                         - Tasks # 2 (2 hours work logged i.e. Time spent = 2)

                         - Tasks # 3 (3 hours work logged i.e. Time spent = 3)

So, the rule would update the 'Time spent' field of the "User story: A" as Time spent = 6 h.
automation rul.png

3 answers

1 accepted

0 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 18, 2022

Hi @Sehreen Jafry 

There are specific triggers/actions for logged work. Try this:

  • TRIGGER: Work Logged
  • CONDITION: Your existing condition is fine
  • BRANCH: Your existing branch is fine
  • ACTION: Log Work
    • Time Spent: {{worklog.timeSpentSeconds}}
    • Date Started: {{worklog.started}}

@Mark Segall ,

I am stuck on the 'ACTION: Log work' step.

Jira isn't allowing me to use the same field 'Time spent' for the user story level.

It allows me to use 'Time spent' update as a trigger, but as you can see in the image above, when I try to find the 'field' in the 'Parent' to place the sum of 'Time spent' of the sub-tasks, I can't find the field.

Can you please guide?

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 18, 2022

In your screenshot, you're using the Edit Issue action.  You need to change that to the Log Work action.

@Mark Segall ,

I can't believe that actually worked. 

I just have one follow-up question as a newbie to the Jira automation rules.

Question: If I want to build the same rule but this time on the 'Epic' level so that Epic's time logged is the sum of the 'user stories' under it, just like the rule created for user stories reflecting the sum of time logged for their sub-tasks.

What's the best practice? Should I create another rule, which is fired based on this rule's firing? Or, is there another better way?


timspent sum.png

Like Mark Segall likes this
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 18, 2022

You can add it to the existing rule.  You would just add another branch based upon JQL at the bottom of the rule to branch into the epic like this:

key = {{issue.parent.Epic Link}}

Then add another Log Work action setup identically to the one you have in the first branch.

@Mark Segall 
Thank you so much for your reply. Really appreciate your time.

I realized something after having this discussion here.

1. Jira is already calculating the 'sum' of the time logs of the sub-tasks of a user story and saving that in the 'Σ Time Spent' field of the parent user story. I had four tasks under the following user story and the accumulated score is under the  'Σ' column.
sumof time spent.png

2. The 30 minutes logged on the user story itself, are populating under the Time Spent column, and they are getting summed up under the 'Σ Time spent' column as well.

So, that suffices what I needed without adding the automation rule to it.

For Epics, I followed the following thread and the automation rule described here worked well for me.

https://community.atlassian.com/t5/Automation-questions/How-to-use-automation-to-sum-up-in-EPIC-the-hours-logged-in/qaq-p/1954914#U2082731
 

Like Mark Segall likes this
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 19, 2022

Ooh - I learned something new.  Thanks for sharing that the roll up is available out of the box.

Like Sehreen Jafry likes this

This is what I wanted in Automation JQL.

This really helped me to get time spent of sub-task under lookup value in Automation

 

{{issue.subtasks.timetracking.timeSpentSeconds.sum}}    <<< For sub-task Time Spent

{{worklog.timeSpentSeconds.sum}}    << for task Time Spent

 

Adding both I got rollup at Task which is similar to Aggregate (Sigma) Time Spent

It really solved my problem. 

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 10, 2023

Hi @Yong - Note the final answer on this.  The rule is not required.  Jira automatically rolls up time spent so whether you're logging new time or editing a previous entry, the Time Spent field will provide an accurate sum of time spent.

This rule works for Log Work action when time spent is logged, but how about the update/deletion of alreay logged time? How do we write the automation rule then?

Yatish Madhav
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 09, 2023

I would like the same. I am working on this automation now ... but agree with @Yong  -  worklog sync should cover work log added, updated and deleted.

I am thinking of adding a scheduled task that runs through all epics then updates the worklog on them for all their child issues. Not ideal but theoretically this should work. Right?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events