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
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
Description of the behaviour:
I want to add more than 1 labels from one issue to another one (eg. from parent to child) whereas the let´s say the child already got 2 labels and the parent has 2 different labels.
I tried to update a linked issue´s label field as follows:
but audit log output says looks like:
Hooooly moly..... :o :o how could I oversee this option??? OOOOMG......
Thank you very much @Curt Holley (even if I invested the whole evening in trying to find a solution for this haha)
Well....learned a lot. therefore: it´s worth it.
Thanks guys for that great solution and lesson :)
So as I mentioned in the other post, the error you got is because the "add" function can only take a string, not an array.
But after solving Dane's issue with a bunch of ugly Smart Value JSON hackery, I realized your problem wouldn't be much harder. It requires a temporary variable, because once we branch to the Destination issue, we apparently can't access the original issue's field values.
Basically we set a Smart value variable originalLabels (from the blocking issue):
And then we Branch to the Destination issue (what's being blocked) and edit using More options -> Additional fields:
So it ends up looking like this:
Let me know if this works, and if so, can you vote for this answer?
uff.....a lot of things for me to learn from this example :) Haven´t been using smart value functions but will definitly take some deeper insights to understand what is possible with replace, split, etc.... :o :o
unfortunately the solution doesn´t work. See my audit log:
AH, I think I forgot to take into account this case:
* If the blocking issue (originalLabels) does not have any labels, then I should not include a comma.
Basically I ended up it trying to update with this invalid JSON for labels:
(Note the extra leading comma.)
Ugh.... I think this can be fixed with some conditional array trickery or by adding a condition to skip the edit in case the blocking issue has no labels, but @Curt Holley has already provided a much. better. answer.
I'm gonna take a nap. :-}
I lied. :-}
I couldn't help myself. Here's the corrected JSON:
And the originalLabels variable is no longer required.
Obviously this is overly-complicating things, but I'm putting this here in case anybody else has to do something a little trickier with conditionals in JSON.
It's not quite as much of a headache as I initially feared.
One thing I thought of - if a blocking linked issue is unlinked, I don't know if you want to remove its labels from the blocked issue, but if so, you'd need another rule.
Additionally, you'd want to make sure that those labels in any other blocking tickets.
Yay, more conditions. :-}