Hello,
How can i do a Scriptrunner condition if value is present in labels field.
Ex :
def Labels = issue.getLabels()
def Type = issue.getIssueType().name
if((Type == "EPIC) && (Labels =="Hello")){ ...
Regards,
Try, please, next code:
Set<Label> labels = issue.getLabels()
String issueTypeName = issue.getIssueType().name
if((issueTypeName == "Epic") && (labels.label.contains("Hello"))) {
//Do what you wanted to do
}
p.s. it's bad idea to name variables like Labels or Type. They can interfere with imported classes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please, add this string to imports
import com.atlassian.jira.issue.label.Label
or change string at line 7 to:
Set labels = issue.getLabels()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.