Im sure this is a bug but cant find where to log it.
The scenario I'm trying to create is to copy all labels matching "AssetMaintenance_*" from an Epic to it's child issues.
If I loop on children issues then
Edit Issue fields - advanced field editing
it works
{
"update": {
"labels": [{{#issue.parent.labels.match("(AssetMaintenance_[^,]*)")}}{"add": "{{.}}"}{{^last}},{{/}}{{/}}]
}
}
However if I use the same statement and assign it to a variable it fails
Create variable
parentLabelList = issue.labels.match("(AssetMaintenance_[^,]*)")
Then loop on children issues then
Edit Issue fields - advanced field editing
it fails
{
"update": {
"labels": [{{#parentLabelList}}{"add": "{{.}}"}{{^last}},{{/}}{{/}}]
}
}
ERROR: Error while parsing additional fields. Not valid JSON.
the problem is I have to do an if condition and copy and paste the logic to check the count before looping. So I have to copy the complex regex twice :(
Hi @Guy Derriman -- Welcome to the Atlassian Community!
Would you please post images of:
Those will provide context to help explain this symptom. Thanks!
Until we see those, I suspect the problem is you are missing a split on your created variable before you try to iterate over it in the advanced edit. The source labels were a list, but the variable is just text.
{
"update": {
"labels": [{{#parentLabelList.split(",")}}{"add": "{{.}}"}{{^last}},{{/}}{{/}}]
}
}
Seeing the complete information will confirm this.
Kind regards,
Bill
This was it Bill, thanks so much for your time and effort to point it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! I am glad to learn it is working.
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.