How on subtasks creation, I can find if the parent has a label that ends with "_anything" and add the same label to the created subtasks?
Hi @Warda Basta
There is a way to do this using smart values. You can filter out the labels on the parent, using the endsWith() function, and set that list on the issue using the More Options Advanced Field Editing
The text being used here in the Additional fields section is
The above will set the labels on the sub-task to be the parent's labels with suffix of "anything", so if you have any other rules which also add labels on creation, they will overwrite/clash with each other. If you want to just add the labels, use
That will add the labels without removing any existing labels on the issue.
Hi @Warda Basta
What problem are you trying to solve doing this? Why not just copy all of the labels to the children?
The use case you describe is not that simple, as you would need to parse each label to determine if it contains your text, such as "_anything". In addition, what do you want to happen if that label is removed from the parent: do nothing or also remove it from the sub-tasks?
Trying this would require using the technique of advanced branching and a text search on the label using the function endsWith() and then another branch inside of that for sub-tasks...which is not possible at this time (nested branching).
I was thinking the problem is that you can't do a native JQL search for labels with wildcards. (The solutions out there rely on the on-prem edition of ScriptRunner to get the issueFieldMatch function.)
If I'm understanding you, @Bill Sheboy your solution would require iterating through a bunch of issues and checking each label with endsWith(), right?
Hi, @Darryl Lee
Yes. I made a test rule which can find labels matching a pattern that way. The challenge is then updating the sub-tasks. What I did not try: using a regular expression instead to identify the labels (using conditional list processing), store that, and then iterate over the sub-tasks in a branch.
Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events