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

How to use automation to sum up in EPIC the hours logged in child tickets ?

Edited

Hello all !

I'd like to do exactly what the title says.

So according to the details from this article https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115

I've set up the rule below:

Sans titre.png

But in "Audit Log" I got error below :

  • Log work
    • Error trying to log work against an issue
    • Worklog must not be null., You must indicate the time spent working. (timeLogged)

 

Then I've tried the to set up the rule below

Capture d’écran 2022-02-24 100046.png

But I've the same error.

Do you happen to have an idea of the problem ?

Thanks a million in advance for your help !

Pierre.

6 answers

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 24, 2022

Hi @Pierre Allard ,

As the article mentioned in your question already points out: it´s not that straight forward with epics. Issues within an epic can not be pointed at directly via "child" connection.

In case it´s about stories/issues directly in an epic I solved this with a "lookup issues action" in between --> see screenshot

image.png

Please let me know if this helps.

Best
Stefan

Hello Stefan,

 

Here's what I did in my rule and that works very well ! :)

Capture d’écran 2022-02-24 161439.png

Thanks a lot for your help!

 

Best.

Pierre.

Like # people like this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 24, 2022

You are welcome @Pierre Allard 

Please be so kind and accept the answer in order to this question appears solved which helps other users in need for the same information find that solution more easily ;)

Best
Stefan

@Pierre Allard 

Can you please let me know what you wrote in the Date started field?

 

Thanks,

Brinda

Screenshot 2022-07-14 145142.png

Like Erika Simon likes this

I have the same question. I believe it's {{now}} based on Pierre Allard's Feb 24, 2022's screen shot above, but I still can't get it working.

0 votes
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

Thanks for the post and the comments, all. 

I have noticed many articles like this BUT it seems either something is missed or it is flying over my head :D

With trigger Work logged for all operations, does the update or delete of task worklogs reflect on the Epic? I noticed that if it is updated, the new time is added to the epic and if existing worklog is deleted, that same time is added to the Epic. Both of these seem incorrect. Also, it does not look like we can identify if it is added , updated or deleted.

Any idea please?

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 11, 2023

Here is a screen grab. The add work log, update work log and delete work log all log the time additionally to the Epic where it should actually add/update/delete accordingly. i.e expecting the Epic to have the same work log total as the child issues, but the Epic simple appends the total that is added, updated and delted as well.

Hope that helps in helping me :)

Screenshot from 2023-10-10 17-10-31.png

Thank you

Hi @Stefan Salzl ,

Could you please instruct me how to sum up to epic the time spent with brunch or rest API, as you mentioned above?

 

Thanks,

Hila.  

Hi @Stefan Salzl ,

colud you please instruct me ho

Hi Guys, 

Do you know How do it for Jira Data Center?

Hey @silfarney_zanatta , is your need still relevant?

Do you have Scriptrunner?

With kind regards
Slava

Hi @Slava Gefen ,

Yes, I still need a solution and I have Scriptrunner.

Let me know your feedback.

Thanks in advance!

Hey @silfarney_zanatta , great!

The last question! Do you want to sum up logged work in additional field, e.g. called Sum of Worklog, or do you want to use Native Worklog in Epics and make read-only?

I would like add this information in Native Field "Worklog".

But I think that is better use a custom field if us will use Scriptrunner, right?

Hey @silfarney_zanatta sorry for the delay.
I thought we could do without Scriptrunner, if you need to implement it in new issues. If some stories already have worklog, firstly we need to update Epics with actual data.

So it turned out that the Automation is pretty simple:

1. We start from Work Logged action

Capture1.JPG

2. Then we check that Epic exists 

Capture2.JPG

3. Then we go to Epic

Capture3.JPG

4. And finally add to Epic Work log that just was added to a Story

Capture4.JPGCapture5.JPG

After that in Epic worklog will be adjusted each time work logged in any Story:

Capture6.JPG

You just need to think if worklog is updated or deleted. In this case we can implement if-else condition.

Let me know if it's working for you 😉

With kind regards
Slava

Like # people like this

@silfarney_zanatta and I forgot to mention, that you need provide work log permissions in Epic only for Automation user, if you don't want users to put worklogs in the epic by mistake.

Regards
Slava

Thanks so Much @Slava Gefen

My last question, this solution will get only the Time Spent in Story right? (not get the information from Sub-task (belongs to story).

Note. I am using the Jira Data Center.

Hey @silfarney_zanatta 

My last question, this solution will get only the Time Spent in Story right?

Yep, it takes Worklogs from all Story level issues to Epic. Do you want to provide from Sub-tasks to Epic also?

Note. I am using the Jira Data Center.

Yes, my screens are from DC 👍

Regards
Slava

Hey, @Slava Gefen Thank you so much! I will try this -- does it work for Jira Software too? (I see you worked this up for Silfarney_zanatta, who uses Jira Data Center.) I definitely want to include from subtasks to epic also. Thank you again, I will try this if you think it works also for Jira Software!

Erika

Scratch that, @slava_Gefen. I was able to make Hugh Lampert's suggestions above work for me in Jira Software. Thank you!

Erika

Hey @Slava Gefen , yes I need get the information from ALL Stories and Sub-tasks.

Thanks again.

@silfarney_zanatta sorry for the delay!

yes I need get the information from ALL Stories and Sub-tasks.

In this way which behavior you are expected when a worklog was added to a sub-task?

Do you want to add it to Sory's worklog and then go up and add to Epic's?

Or just go two levels up to Epic and add there?

@Erika Simon hey, yep in Cloud version it's much easier!

Regards
Slava

Hi @Slava Gefen , 

In this way which behavior you are expected when a worklog was added to a sub-task?

<Zanatta> In My it is possible I see the Total of Worklog hours in Story + Sub-task (into Story.  So my expectation is add the same view but in EPIC (get all worklog from Stories + Sub-tasks)

Do you want to add it to Story's worklog and then go up and add to Epic's?

<Zanatta> My expectation when a work log hours was added in a Story or Sub-Task, I would like show it in EPIC level.  (So we have today this feature to show the Total of Worklog into Story (Story + Sub-Tasks)

Or just go two levels up to Epic and add there?

<Zanatta> In my case I dont need add Sub-Task worklog in Story (because we have it today) but I need add it in Epic Level.

 

Note: I would like do the similar solution that we have in Jira Cloud using ({{issue.childissue.timeSpent.sum}}) . But it not works in Jira Data Center *.sum

 

I don't know if you got my point above.

Thanks in advance!

Hey @silfarney_zanatta sorry for the delay I was away a little)

I don't know if you got my point above.

I hope I did.

So, in the rule above (This my comment )

we need to change the first condition with if-else block:

Capture7.JPG

And put everything else under it.

Then in else block you need to put this condition:

Capture8.JPG

Capture9.JPG

And then for the branch use JQL with this smart-value:

Capture10.JPG

For the worklog action use the same that we used in Story level.

Finally, you will see in Epic worklogs from Sub-tasks:

Capture11.JPG
Capture12.JPG

Let me know if you have any question.

Hope it helps!
With kind regards
Slava

@Pierre Allard Have you come across the issue of the automation double counting time spent entries?

For example, if I enter 1h of work on a task within an epic, the epic will show 1h. However, if I enter another 1h of work on that same task or another task within the epic, the epic shows 3h. Which makes me believe it counts the previous entries every time.

@Brellison Running into the same issue here. Every time the automation runs, instead of 'over-writing', it adds a new worklog to the previous one hence adding to the previous value.

One workaround would be to delete the previous worklog on epic level before running the rule.

Hi @Brellison @Sehreen Jafry

You're right, I've faced the same problem. But it seems that automation rule cannot delete worklogs...

@Pierre Allard 
Yeah so I ended up just manually deleted the previous worklog before running this particular automation rule.

That's the only thing I can think of at the moment, till there can be a way to delete the worklog via automation first and then run the automation to sum up the logged hours and save on the EPIC level.

Since the work log, IS a rolling work log and you can't delete existing entries through automation, the answer is to check if the sum of the timespent in the exisiting  entries in the EPIC log equate to the sum of the timespent on all the child tasks before adding a new entry to the EPIC.  If the time spent on the EPIC is less than the time spent on all the child tasks, add a new entry to the epic with the difference:

 

JiraUpdateEPICTimeSpent.png

Like # people like this

Nice work @Hugh Lampert!

I would only divide by 3600 instead of 60, I think you're maybe logging in minutes when they should be in hours. I can't tell if that's how it should work for you because I use Tempo Timesheets, so I just changed this and it worked very well.

Like # people like this

Thank you very much @Hugh Lampert , that works very well ! :)

I am not using Jira cloud, its Jira Data Center. So there is no "LookupIssues". What's the alternative in that case?

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 20, 2023

Hi @Manish Bhardwaj 

depends on your specific requirement but in general I see 2 ways to do:

  • creating a branch with a jql branch or
  • add a "send webrequest" action that does a JQL

Best
Stefan

@Hugh Lampert do you mind to post the JQL of the automation in text were?

@Hugh Lampertthis is genius. But in the very last step (Then: Log work), what should be entered for the required field "Date Started"? Please see screen shot. It's not working for me, and I think it's because I don't know what to put into this field. log work date field.png

Regarding what to put in the "Date Started"  field:

The "date started" field can be left as "{{now}}".

If this isn't working for you and you have "{{now}}" in this field, then there is some other problem; check the evaluation log.

Thanks @Hugh Lampert for your quick reply. Where will I find an evaluation log? I'm using {{now}} and it isn't working. I'm not getting any errors, but the time logged on children does not show up on epic.

UPDATE to my 4/19 note -- it's now working for me! Thank you so much, @Hugh_Lampert!

@Hugh Lampert also not working were. Can you please export your automation to a JSON file? In my case you can find here the log2023-04-20_09h16_48.png

@Hugh Lampert can you help with the issue above?

@Manish Bhardwaj hey ✋

I am not using Jira cloud, its Jira Data Center. So there is no "LookupIssues". What's the alternative in that case?

You can try my solution for DC above (Now it describes create worklog only).

Regards
Slava

Like Gazaliy Alade likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events