Automation to help log estimate and time spent from linked tasks to paretnt story

Chirag March 9, 2023

I am trying to understand how to utilise automation on Jira to help solve a problem.

We do not use sub-tasks instead link multiple tasks to story. Example below:    

  • Story 1 - This is the main story 
  • Task 1 - These are NOT sub-tasks but just a 'linked issue' to the story 1        
  • Task 2
  • Task 3

Team members put in the estimates and time spent against each task and nothing is logged on story level.  I want to view the total of 'time spent' for task 1, 2 & 3 on story 1. How can automate this using Jira automation ?

2 answers

1 vote
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 9, 2023

Hi @Chirag 

You could do the following rule, but it comes with certain conditions:

sum from tasks to stories.png

 

Story to task must always have an OUTWARD link, e.g. "blocks". But not "is blocked by":

 story to task.png

 

Of course, you will not choose the link type of "block", but use an appropriate one. As long as the one you choose is found on the outward description:

outward description.png 

Chirag March 14, 2023

Hello Alex,

Thank you for the reply and help. I am still having issues trying to get the expected outcome. Details below:

  • TP-17 is a story which blocks 2 tasks:
    • TP-15
    • TP-16

I was able to create the same automation setup that you had shared. It is showing the outcome also same as the one in your screenshot. My screenshot is below.

Screenshot 2023-03-14 at 10.16.18 PM.png

But somehow it is not working for me. 

The log gets created only when I unlink TP-15 > log time spent in TP-15 > then link it again to TP-17. But even after that TP-17 continues showing no update in neither estimate and time spent fields.

 What I am looking for is that if I log any time in TP-15 or TP-16 it should automatically add up and show in TP-17.

Is that possible? What am I missing here? 

 

Thank you,
Chirag.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2023

@Chirag there is a space between "OriginalEstimate". You should write:

{{lookupIssues.Original Estimate.sum.divide(60)}}

Change this to both log and edit component. 

Chirag March 15, 2023

Hello Alex,

Thank you for reviewing and identifying the issue. I have made the mentioned change. Screenshot below:

1 Screenshot 2023-03-15 at 10.58.08 AM.png

 

I was not sure so edit component is setup like this. Is it okay ?

4 Screenshot 2023-03-15 at 10.59.52 AM.png

Few points:

  1. It is still running only when I log I unlink TP-15 > log time spent in TP-15 > then link it again to TP-17. But even after that TP-17 continues showing no update in neither estimate and time spent fields.
    1. In the screenshot below for Task TP-15 I logged 1 hour 2 Screenshot 2023-03-15 at 10.57.27 AM.png
    2. The task is linked to a story TP-17. I am expecting the story to show 1 hour but there is no update on story level. Screenshot below:3 Screenshot 2023-03-15 at 10.57.07 AM.png
  2. So there are 2 problems :
    1. I am required to unlink >log hours on task and then re-link the task to the story to run the automation. Instead it should run even if the task is linked 
    2. The time logged on task level does not even reflect on story level.

 

Thank you,
Chirag.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

@Chirag the edit component should have the smart value inside:

{{lookupIssues.Original Estimate.sum.divide(60)}}

edit orig estimate.png

After making this change, check the audit log exactly after you link an issue. Does it can triggered, or is "stuck" at "config changed"?

Chirag March 15, 2023

I updated it as suggested.

I added time log to a task and then linked it to the story. Still no update on story level.

Here is the screenshot of the log:

Screenshot 2023-03-15 at 2.38.54 PM.png

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

@Chirag did you take into consideration the condition I told you in my first comment?

Story to task must always have an OUTWARD link, e.g. "blocks". But not "is blocked by"

My automation works fine. See my gif below :

ezgif.com-video-to-gif (1).gif

Chirag March 15, 2023

@Alex Koxaras _Relational_ 

Now I get it. Actually the confusion was with the field. I was trying to get the 'Time Tracking' log that is put in the individual tasks to be accumulated and shown on story level from the start.

What you suggested was the same but for estimate. Which makes perfect sense. I saw your audit log screenshot again and noticed that 'Log Action' log shows 360 (first image you shared) but for me it stayed blank always. It is working for me now for estimates.

Can we have something similar for time tracking / time log as well. So if there are 2 tasks C and D. For C the assignee has logged 2 hrs and for D 3 hrs then for the linked story B should show total hours logged in C and D i.e. 5 hours. I am fine if we use a custom field. I understand having 5 hours auto logged in B will be duplication of effort but I still need to have that value on story level for evaluation/planning. Is that possible ?

 

Thank you,
Chirag.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

You can have the same thing for Remaining Estimate (you follow the same we did previously, and edit the corresponding field with the new corresponding smart value), but with time spent, it will not be the proper way to do it. You will have duplicate logs of time spent.

Chirag March 15, 2023

I am trying to get the total value as just text in a custom field of the story e.g. 2d 1h. Not working for me.

Also there is another issue. This should work everytime there is an update and the assignee logs time into the tasks (linked to a parent story). Without them having to unlink and re-link just to update the story field value. That would kill the whole purpose of having automation.

I will leave it at this.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

@Chirag it's best if you can gather all business requirement for your problem, because as I see it you haven't though how you want this rule to work.

Chirag March 15, 2023

My opening question states business requirement clearly. I repeated the same multiple times even till the last reply:

I want to view the total of 'time spent' for task 1, 2 & 3 on story 1. How can automate this using Jira automation ?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

You are right @Chirag. My mistake, I apologize.

0 votes
omcg March 9, 2023

Hello!

There is a similar question that was answered here:

https://community.atlassian.com/t5/Automation-questions/How-to-get-sum-timespent-from-linked-issues/qaq-p/1471579

In the project automation, check for a "time spent" field change, then create a "Branch rule" for the parent issue. In the branch rule, use smart-values and the sum function to add all of the linked child "time spent" fields.

Hope this helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events