Clear value of custom field (checkbox type) using Groovy

Dan27
Contributor
April 15, 2019

Hello,

I would like to clear by groovy (updated event- script listener) the selected value in a checkbox custom field.

I tried without success those codes:

def X = customFieldManager.getCustomFieldObject("customfield_12345") 
issue.setCustomFieldValue(X, null)

 

def X = customFieldManager.getCustomFieldObject("customfield_12345") 
issue.setCustomFieldValue(X, "")

 

Can someone help me with it ?

Thanks,

Daniel

1 answer

1 accepted

3 votes
Answer accepted
Dan27
Contributor
April 15, 2019

It worked like this:

 

CustomField X= customFieldManager.getCustomFieldObject("customfield_12345") 
X.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(X), null), changeHolder)

Suggest an answer

Log in or Sign up to answer