Skip to main content
Example scripts
arrow icon
To homepage
Jira
Cloud icon
Cloud

Get Custom Field Value

Created 3 month(s) ago, Updated 8 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
groovy
def eventIssue = Issues.getByKey(issue.key as String)
def expectedValue = 'some value you expect to see in the custom field'

//get custom field value
def value = eventIssue.getCustomFieldValue('customFieldName')

//clear custom field value
if(value != expectedValue) {
    eventIssue.update {
        eventIssue.clearCustomFieldValue('customFieldName')
    }
}

Having an issue with this script?
Report it here