Forums

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

Jira Automation: Post a list of estimated child issues as a comment on the parent epic

Hamza Chundrigar
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.
October 25, 2022

Hi everyone,

I can't seem to figure out on how best to build the Jira Automation for my use case so I would really appreciate any guidance.

 

Use Case

  • Epic Alpha has five child story issues linked within it.
  • Each story has 3 fields that need to be populated in order to satisfy the condition. The fields are
    • Label = Backbone-Sync
    • Original Estimate > 0h
    • Custom Field (called 'Estimate Ready for Approval') = Yes
  • The automation should trigger upon a self-reflecting transition (when the status goes from Awaiting Estimate back into Awaiting Estimate)

Desired Outcome

Based on the info above, here are the steps in what I would like Jira Automation to do:

  1. End User transitions Epic Alpha from Awaiting Estimate back into Awaiting Estimate
  2. The system then looks for all child issues under the Epic that meet the following conditions:
    1. Child issue has the appropriate label
    2. Child issue has been estimated (Original Estimate field has an estimate greater than 0) — we are not using story points here.
    3. The radio button custom field Estimate Ready for Approval has the option Yes selected in the Child Issue
  3. The system then publishes the list of all of the child issues as a comment on the parent (Epic) issue

The comment would look something like this:

Please see below the list of issues (under Epic Alpha) that have been estimated and are ready for approval

  • Story 1 Issue Summary --> <Original Estimate Value>
  • Story 2 Issue Summary --> <Original Estimate Value>
  • Story 3 Issue Summary --> <Original Estimate Value>
  • Story 4 Issue Summary --> <Original Estimate Value>
  • Story 5 Issue Summary --> <Original Estimate Value>

The total estimate for all the estimated issues is = <Total Sum of all the Original Estimate Values for Stories 1-5>

 

Screenshot

Here's what I have built so far. I'm not sure if I'm going about this the right way, or if there's a better way to achieve what I'm looking for. I basically got stuck half way, so looking for guidance from this great community.

 

image.png 

 

Thank you

1 answer

1 accepted

1 vote
Answer accepted
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.
October 25, 2022

Hi @Hamza Chundrigar 

A question and a suggestion for your rule...

Question:

What is the purpose of using the transition back to the same status as the trigger?  For example, is another rule or activity causing this "self-transition", or could a manually-triggered rule be more helpful?

Suggestion:

By branching to all issues in the epic and then testing each one with conditions, the rule is looking at more issues than necessary AND will add a comment for each issue.

As an alternative, consider removing the branch/conditions and creating a JQL statement to find the issues in the epic meeting your condition.  Then use that JQL with a Lookup Issues action.  That will allow creating a single comment using this syntax:


Please see below the list of issues (under Epic {{triggerIssue.key}}) that have been estimated and are ready for approval

{{#lookupIssues}}
* {{summary}} --> {{Original estimate|0}}
{{/}}
The total estimate for all the estimated issues is = {{lookupIssues.Original estimate.sum|0}}

 

Kind regards,
Bill

Hamza Chundrigar
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.
October 26, 2022

Thanks Bill, I think you're spot on with your suggestion on foregoing the branch/condition and stick to JQL/Lookup Issues Action!

I'm assuming the Manual Trigger would be on the Epic Issue Type, yes?

Can you please let me know what JQL statement I could use that runs and checks for all story level issues within an Epic (when it is triggered manually, for each Epic).

I would imagine a JQL statement with an actual issue key as a parameter in the automation rule would be redundant since the rule would need to look for the Epic in question upon the manual trigger.

 

Thanks a bunch for your help!

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.
October 26, 2022

Yes, you would manually trigger the rule on the epic...or perhaps use another trigger if that makes sense.

For the JQL in the Lookup Issues action, perhaps try this:

project = myProjectName AND "Epic Link" = {{triggerIssue.key}} AND Labels = Backbone-Sync AND "Original Estimate" > 0 AND customfield_10200 = "Yes"

I recommend trying the query stand-alone with advanced issue search and an example Epic first, then try it in the rule.

Hamza Chundrigar
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.
October 27, 2022
project = myProjectName AND "Epic Link" = {{triggerIssue.key}} AND Labels = Backbone-Sync AND "Original Estimate" > 0 AND customfield_10200 = "Yes"

Thanks Bill — Unfortunately that JQL is not working in the Lookup Issues Action. I tried it in the advanced issue search as well as validating the query in the automation rule. No dice.

Your single comment syntax was very useful though, and I've been able to setup the automation by having me send an email with the list of issues I'm looking for, instead of having that same email content be posted as a comment on the Epic (Parent Issue) which is what I had originally hoped for.

Appreciate your time and effort!

Like Bill Sheboy likes this
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.
October 27, 2022

My mistake, as you need to use originalEstimate and not "Original Estimate" in the JQL.

Also...Is this a company-managed (CMP) or a team-managed project (TMP)?  CMP ones use "Epic Link" and TMP use "parent" to link epics to children.

Once you change those things, please try your JQL in a standalone query with an example Epic.  Once that works, it should also work with the lookup.

Like Hamza Chundrigar likes this
Hamza Chundrigar
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.
October 27, 2022

It worked! Thanks so much, Bill!

There is one more thing that I'm hoping you would be kind enough to shed some light on, seeing as you're quite the automation for Jira expert ;)


I'm trying to list these issues in a table format

 

This is the my automation rule post adjustments:

  1. Trigger/When: Manually Triggered
  2. Condition 1:  Issue Type = Epic AND;
  3. Condition 2:  Status = "Awaiting Estimate"
  4. Then: Lookup Issues 
    • project = "ion8 Backbone Project" AND "Epic Link" = {{triggerIssue.key}} AND status = "Estimate Review" AND originalestimate > 0h AND "Estimate Ready for Approval[Radio Buttons]" = Yes AND labels = Backbone-Sync
  5. And: Add Comment to issue (see below)
Hi Team,

Please review the list of issues (under Epic {{triggerIssue.key}}) that have been estimated and are ready for approval.
----

| *KEY* | *SUMMARY* | *ESTIMATE (Hours)* |
| {{lookupIssues.key}} | {{lookupIssues.summary}} | {{#=}}{{lookupIssues.Original estimate|0}} / 3600{{/}} |

*The total hours for all issues estimated under Epic {{triggerIssue.key}}* = {color:teal}*{{#=}}{{lookupIssues.Original estimate.sum|0}}/3600{{/}}*{color} *hours*

 

^as you can see, I'm trying to display the list of issues, their key, summary and estimate in a table format.

The output is this based on the automation rule above:

image 1.png 

The above is correct; It is giving me only Blue Story 1 details because out of the 3 child issues, only the child issue Blue Story 1 is in the status "Estimate Review" 

image 1.png


However, when I update the status for Blue Story 2 and Blue Story 3 to "Estimate Review" (like seen below)

image 1.png

And now when I try to run the rule, it gives me an error

This is the error message from the audit log:

image.png

What am I doing wrong? Any ideas or suggestions on how I might fix this. I feel like we are so incredibly close, so THANK YOU for all the wonderful suggestions and help @Bill Sheboy !

Best,

Hamza Chundrigar
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.
October 27, 2022

P.S this is the automation rule. I figured I'd post a screenshot of it just in case :)

image.png

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.
October 27, 2022

I believe you were missing the iterator to walk the issues in the lookup.  You can handle that by always assuming you have multiple issues to display by using the iterator like this:


| *KEY* | *SUMMARY* | *ESTIMATE (Hours)* |
{{#lookupIssues}}
| {{key}} | {{summary}} | {{#=}}{{Original estimate|0}} / 3600{{/}} |
{{/}}

 

Like Hamza Chundrigar likes this
Hamza Chundrigar
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.
October 27, 2022

That did the trick!

image.png 

Thanks again for all the help, Bill!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events