You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I'm trying to display the total number of child issues linked to an epic on a custom field in the Epic.
I created an automation that would auto-populate a custom field called "number of child issues linked", but I can't get it to calculate the total sum of this count.
Here's my rule:
I believe the issue is with the Smart Value I'm using {{issue.size}}, it's not counting the total number, it's just displaying the number "1" when I make an update to any child task issues. For eg: I have 4 tasks that are child issues to an epic, I update all the tasks to my automation runs, and my custom field in the Epic (number of child issues linked) displays there is only 1 child issue linked.
I've also tried the {{lookupIssues.size}} smart value and it always returns 0.
Any ideas of what could work?
Hello @carolina
{{lookupIssues.size}} should give you the number of issues returned by the JQL in the Lookup Issue action.
You can use the Log action to print messages and smart values into the rule's Audit Log to help with debugging the rule.
Can you change the Edit action to use {{lookupIssues.size}}, and some Log actions to print out each smart value, then take an action again to trigger the rule? After that share with us the Audit Log details for that execution of the rule.
It would also be helpful if you can show us the parent Epic details to show us the Child Issues section to affirm how many child issues exist in the Epic.
Lastly, why have you opted to use the Issue Updated trigger? That will cause the rule to be triggered for every type of update for the issue. Do you really want it triggered that frequently?
Hi @Trudy Claspill thank you for your reply! I changed the Edit action to use {{lookupIssues.size}}.
I've been doing some research on the Log Action, but I can't figure out what I need to write as the log message :/ I'm new to the game. Do you have any tips?
Here's what the Epic looks like:
You can see that to the right I have a field to display the number of child issues, which should be 2, but it's 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Log Action you can put in plain text and/or smart values. So, for instance, after the Lookup Issues action you could use a Log action to print out the size of the results set:
Lookup Issues returned this many issues: {{lookupIssues.size}}
You can use the Log action to print out any smart value to check that the value contains what you expect.
Can you show us the output of the Audit Log for the rule when it executes? Click on Audit Log above the rule steps. That will show you the logs for each configuration change and execution of the rule. You can click on the Show more to the right of an entry to get more details.
Looking at the rule details you provided and the image of the Epic with child issues I see a problem. In the Epic it looks like the child issues might all be Bugs based on their icon. In the rule you have a condition to check that the issue that triggered the rule (the issue that was changed) is a Task. As this Epic doesn't appear to have any Task child issues, the rule will not update this Epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy,
Thank you so much for your reply! Your comment is correct, I sent you a picture of only bugs when the rule was meant for tasks by mistake.
The audit log came back as zero again :/ and ticket 124 has 5 child tickets linked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make liberal use of the Log Action to print out to the rule execution audit log any smart values that you are trying to use in your rule to make sure they have the values you expect.
After starting the branch For Epic and before the action to Lookup Issues, add a Log action and print out the smart value {{issue}}. You are trying to use that in your Lookup Issue JQL. Make sure that it has the value you expect.
I think you action need to be using {{issue.key}} there instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@tru thank you for the advice, I was able to add a Log Action where you said and it's returning the value as expected, but the rule still says that the {{lookupIssues.size}} is zero... this is so frustrating :( I don't get why it's not working...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should use the singular, not plural, issue
Use {{issue.key}} not {issues.key}}
If you go to the Advanced Issue Search screen and enter the JQL that you use in the Lookup, substituting the actual Epic issue key for the smart value, do you get a set of child issues?
Are these issues in a Company Managed project or a Team Managed project? That information will display at the bottom of the navigation panel on the left when you view the project.
The Epic Link field is used only in Company Managed projects. If these issues are in a Team Managed project then you need to use the Parent field instead
Parent = {{issue.key}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, we've made progress!!
By switching the {{issue.key}} to {issues.key}} the audit log will now return the real values!! However... I've tried testing multiple times and the automation still prints "0" in the "number of child issues linked" field.
See below #124 that should have 6 child issues:
I feel that we are getting so close! Thank you for your help so far, just need to figure out why the field is still showing zero when I have this...:
Additionally, this is a team-managed project and I've also tried changing the "For Parent" branch, but the automation doesn't work, it says the issues don't match the condition and no actions are performed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Trudy,
I finally got it to work!!!
I had to change the "Issue Type does not equal to Epic" to "Issue Type equals to Task" and copy past the rule for all my other issue types, i.e. I had to create 6 different rules, each with different "issue types equals" condition.
AND NOW IT WORKS!! Thank you super much for all your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With the condition being
Issue Type is not equal to Epic
...your rule may have been getting triggered by a transition for a Subtask. That would explain the problem with the issue count from LookUp issues.
If so you can still use just one rule and include all the child issue types in your condition like this
Or set the condition to exclude Epics and Subtasks like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, I did try that but it didn't work. Ultimately the only thing that did work was splitting all the issue types :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's no reason that should not work. If you want to explore that more, please show the rule that uses that method and the full Audit Log for an execution of that rule.
If you don't want to spend any more time on it, that is fine too. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.