Initialize an Epics timeSpent before adding childrens and grandchildrens timeSpent

Ward Schwillens_ Schwillie
Contributor
August 6, 2024

Hi there!

I am running an automation to update the timeSpent of an Epic with the summarized timeSpent value of the Epic's Children and GrandChildren (Tasks, and it's sub-tasks)

In the additional fields of the Edit issue fields action I have this:

 


{ "update": { "worklog": [ { "add": { "timeSpent": "{{#=}} ROUND(({{lookupIssues.timetracking.timeSpentSeconds.sum}}/3600),2){{/}}" } } ] } }


But every time the automation runs, the summarized timeSpent value of the Epic's Children and GrandChildren is added to the timeSpent of the Epic. 

Thus I first need to initialize (set to zero) the timeSpent of the Epic and then add the 

summarized timeSpent value of the Epic's Children and GrandChildren.

Unfortunately the "set" operation is a not supported operation on worklog fields. 

And thus is my question: 

So how do I set the timeSpent field to zero before running the add operation?

 

Thank you very much for your valuable insights!

2 answers

0 votes
Bill Sheboy
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.
August 6, 2024

Hi @Ward Schwillens_ Schwillie 

A couple of options using automation rules are:

  • Whenever work is logged for a Task or Subtask, log the same amount to the Epic.  Then when you need the total (or details) examine the Epic.
  • Whenever work is logged for a Task or Subtask, sum the total for all child and grandchild issues and save it to a custom field in the Epic

Kind regards,
Bill

0 votes
Ward Schwillens_ Schwillie
Contributor
August 6, 2024

Hi Again,

In the meanwhile I found out that adding to the worklog timeSpent actually creates a work log. That was not my intention.

So the question now is:

Is there a field that can be used to store the total time of time spent on the Epic, it's children (Tasks) and their Sub-Tasks?

Thanks again for your insights!

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events