Is there a way in Jira Automation to automatically build the list of components associated with a parent issue (Story, Bug, Task) as a summation of all components associated with all of its sub-tasks?
Thanks
Ian
Hey @Ian Robinson ,
It may be possible. It depends on what you want to do with that list and what event you want to trigger it?
Cheers,
Simeon.
Hey Ian,
You could probably update the parent with the value of the Sub-task as each Sub-task is created. And probably even as the component field is updated for each Sub-task.
But I don't know about doing that on existing records where the values are not being updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
This is what I have so far and it works for adding a component to the list on a sub-task. What I haven't figured out yet is if I remove a component from a sub-task how to remove if from the parent only if it is not included in the component list of any other sub-task of the same parent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Ian Robinson & @John Funk ,
This is more tricky than it seems. I've been playing with a few ideas. Just waiting for a team member to be back tomorrow to see if it is possible.
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright, @Ian Robinson & @John Funk aka Funkmaster!
What a curly one. You've no idea how hard this was. It is very hard to get the fields that were removed and the fields that were added out of the Field Value changed trigger because we're dealing with a multi select so its sets of values.
The approach I took was: whenever the components change on a sub task, recalculate the parent based on all its children. However, even that was hard.
The reason being is that components is a list, eg EG-1 with [a, b] and EG-2 with [c, d].
If i do a smart value of issue.subtasks.components.id then i get all the ids for all the sub tasks. BUT, see the bolding? They're both lists. And they're nested so you end up getting a list of lists: [ [a, b], [c, d] ]. And we can't work with that easily. Eg, this does not work:
The reason being that it just expects a list of values. Not a list of lists.
So, we've had to go hardcore. It has taken myself and Sam a while to come up with a smart value that can create JSON so that we can do this in the advanced section.
The result:
So, what is this doing? In short, the smart value is producing this:
{ "id": "11001" } , { "id": "11167" } , { "id": "11002" } , { "id": "11167" } , { "id": "11165" }
which is json and we can use in the advanced fields.
I'm not sure how reliable this will be but its the best I can offer.
Here's advanced fields text:
{
"fields": {
"components": [ {{#issue.subtasks}} {{#components}}{{^isEmpty}} { "id": "{{id}}" } {{/}}{{^last}}, {{/}}{{/}}{{^last}}{{^components.isEmpty}}, {{/}}{{/}}{{/}} ]
}
}
and my rule:
If that still doesn't work, we might have to give up on this one! Best of luck!
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.