Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in automation for jira with summ of original estimate in parent task

Oksana Baier January 13, 2023

Hello the Team, 
I need help)

We made an automation in Jira for summ of original estimate from subtasks to story and from tasks in erpic to epic

 

But

 

We have 3 situation, when we dont know how to automate

May be you have examples or detailed instrustion for it

:one:Sub task changes parent link:
- need to recount original estimate for old parent and for new
For new - no problem, I done
For old - ???

:two:Sub task change type to task without parent
- need to recount old parent ???

:three:Task/story/bug change epic:
- need to update old epic estimate and new epic estimate 
For new - no problem, I done
For old epic - ????

2 answers

0 votes
Trudy Claspill
Community Champion
January 13, 2023

Hello @Oksana Baier 

Are you working with issues in a Company Managed project or a Team Managed project?

If you are working with a Company Managed project you can use this rule to detect that the parent has been changed. This applies to your scenarios 1 and 3.

Trigger: Issue Updated

Condition: Type is not Epic or Subtask (this condition depends on whether the rule is triggering for a Story or a Subtask)

Condition: Advanced Compare Condition

Within the Advanced Compare Condition you can review the changelog to see if it was the Epic Link field that changed. You can access the before change and after change values for the Epic Link field thus:

before: {{#changelog.epic link}}{{fromString}}{{/}}

after: {{#changelog.epic link}}{{toString}}{{/}}

If the two values are equal, the parent Epic was not changed.

Similarly you can find out if a subtask was moved under a new issue by examining the change log and looking at the "parent" field. See this post.

before: {{#changelog.parent}}{{fromString}}{{/}}

after: {{#changelog.parent}}{{toString}}{{/}}

If they aren't equal, then the "before" smart value gives you the issue key of the original parent. You could use that in a Branch/Related Issues/JQL to retrieve the original parent:

issue = {{#changelog.epic link}}{{fromString}}{{/}}

After that point, I haven't worked through a final solution. I can think of two possible options:

1. There may be a way within the rule to execute the recalculation for the original parent. Maybe with a Lookup Issue action within the Branch. I haven't tried to work that out.

2. Set a custom field in the original parent issue that indicates a recalculation of the sum needs to be done. Use a separate rule to detect a change to that custom field and to execute the recalculation.

 

I'm still looking through my notes for information about detecting that a Subtask has been converted to a non-Subtask issue.

Oksana Baier January 16, 2023

Thanks a lot
I made rule for all cases except one:

When we move sub task to task - we cannot find previous parent task by 

{{#changelog.parent}}{{fromString}}{{/}}

It is last case for my rule and I can share the rule for help of community, cos I saw many requests for this issue

How I can know parent link in this case? Can you help me? :)

Trudy Claspill
Community Champion
January 16, 2023

I have not been able to solve that problem.

Before converting a sub-task to an issue, the sub-task's parent issue is noted in the {{issue.parent}} field.

If the parent issue was a child of an Epic, then when the sub-task is converted it is also made a child of the same Epic. That changes the value of the {{issue.parent}} field. Unfortunately the change to the field is made in two steps. First the Parent field is cleared, then the Parent field is set. I don't know how to parse the change log to get the information for multiple changes to a field.

John Driscoll
Contributor
January 19, 2023

I'm wondering, if creating a 'linked issue' prior to converting the subtask might provide a method to obtain the original estimate of work?

0 votes
John Driscoll
Contributor
January 13, 2023

Hi Oksana,

   Have you tried using the feature "Issue link deleted" ?

This rule executes when an issue is unlinked from another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B.
To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}

Suggest an answer

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

Atlassian Community Events