The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
This may be an extremely noob question but how do I set a label in the Additional issue actions? I can see how to set specific fields, but I can't see the method for labels (I tried the custom field script, but that didn't work either).
A small problem with Rambanams code is, that the issue doesn't exist at the time the additional issue actions are executed. The following slightly modified code works:
import com.atlassian.jira.issue.label.Label import com.atlassian.jira.issue.label.LabelParser def labels = new HashSet<Label>() labels.addAll(issue.labels) labels.addAll(LabelParser.buildFromString("NewLabel")) issue.setLabels(labels)
I have been bashing my head against the wall for days with this exact problem.
Big Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the following code we use in java, so you can convert to groovy
import com.atlassian.jira.issue.label.Label; import com.atlassian.jira.issue.label.LabelParser; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.MutableIssue; MutableIssue mutIssue =ComponentAccessor.getIssueManager().getIssueObject(issue.getKey()); Set<Label> labels = new HashSet<Label>(); labels.addAll(mutIssue.getLabels()); labels.addAll(LabelParser.buildFromString("New Label")); mutIssue.setLabels(labels);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.