Hello,
I created a custom field label type:
I would like to set a value using script runner (script listener).
How can I set custom field value to a label field using script?
BR,
Daniel Mor
Hi @Dan27 ,
You can have a look at this other thread where there are options for Jira 6+ and Jira 7+ : https://community.atlassian.com/t5/Jira-Core-questions/How-do-I-add-a-label-in-post-function-using-scriptrunner/qaq-p/455147
That should also work in Jira 8+. Please scroll till the end of the answers as the Jira 7+ API changed a bit the script (all is explained).
Let us know if you still have issues!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Daniel! try this:
issue.setCustomFieldValue(labels_field, [new Label(null, issue.getId(), labels_field.getIdAsLong(), "Label")] as Set)
more can be found here:
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.