Hello. I am using the JMWE Create / Clone issue function, and have a formatting question.
Under 'Set fields of new issue', I would like to have the new issue's labels be:
Copy all labels from current issue. Add label 'xyz'. If current issue has label 'abc', remove it.
So that I would end up with:
Current issue labels: abc def ghi
New issue labels: def ghi xyz
I have tried various Groovy syntax, but keep getting errors. Any help would be appreciated. Thank you.
Hi
You would need to select "Set field value from Groovy" and write the following Groovy expression.
def labels = issue.get("Labels").findAll{
it.label != "abc"
}
labels.add("xyz")
return labels
Regards,
Radhika
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.