Look if a Checklist value is set using groovy expression

Padma Venkatrangan June 20, 2017

I am trying to see if in a bunch of checklist values, a particular one is set in the condition of a workflow transition:

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.CustomFieldManager

def customFieldManager = ComponentAccessor.getCustomFieldManager();

def cf = customFieldManager.getCustomFieldObjectByName("MY CHECKLIST");

def cfConfig = cf.getRelevantConfig(issue)

def cfType = cf.getCustomFieldType()

def value = cfType.getSingularObjectFromString('{"name" : "Data Validation", "checked" : true, "mandatory" : false}')

 

return issue.get("MY CHECKLIST").containsValue(value)

 

This does not work. Any help please?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events