I have a custom field that is of type label. Any time this field is changed on a subtask, I would like to overwrite the parents field with all the labels from its children tasks.
I have the easy part done below, now I need to replace "bugfix","blitz_test" with the syntax to get each label from all tasks siblings and add them to the parent.
To add all of the labels from all of the subtasks, you first need to get all of those labels.
One way to do that is with the Lookup Issues action:
Hi @Bill Sheboy thank you very much! With your guidance I almost got the exact result I'm looking for. Except that the labels are being added with [ ] around them. I tried to substitute asJsonStringArray with asJsonString but I get errors.
Is there an easy way to remove the [ ] from the labels?
Hmmm...the question is, what is adding them: the initial parsing or the later conversion to the JSON string array.
Let's assume it is the first one, and so use this as the source to try removing them:
Thanks again Bill, it looks like it was latter. I was able to address it removing all the square brackets after array and then wrapping it all in a single [ ] to get my desired outcome:
Hi @Craig Easton and welcome to the community,
I´m not quite sure if I can follow correctly. What exactly does "all tasks siblings" mean?
So to clarify:
Am I assuming right that when Issue-A is the parent and Issue-B is the subtask --> when Issue-B field Teams is updated then labels from Issue-B should be written to Issue-A (parent) and overwrite eventually already existing labels there?
If so the following does the work:
If your customfield is not available in the dropdown this advanced edit in JSON would should work:
BTW: you can find an excellent docu of advanced JSON edit here:
Please let me know if this was helpful.
Hi @Stefan Salzl thanks for the response.
Yes in your case, what you describe does work. However it fails in the following scenario:
Issue A - Parent
Issue B - Subtask of Issue A
Issue C - Subtask of Issue A
Add Team-B to Issue B -> Issue A Team = Team-B
Add Team-C to Issue C -> Issue A Team = Team-C
What I would like the result to be is that Issue A has Team = Team-B, Team-C
As well, if I removed Team-C from Issue C I would like Issue A to be reflected with Team = Team-B.
I hope that makes sense and why the 'copy x from trigger issue' didn't work for me even though my custom field is listed there.