Hi All
We recently added a numeric field that records the number of times the state has changed (for example, reject), and we want to count the number of times we reject when the issue ends. I used scriptrunner to write the following script, prompting an error, how should I optimize this code
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def id = customFieldManager.getCustomFieldObject('customfield_13834')
def value = issue.getCustomFieldValue(id)
value ++
issue.setCustomFieldValue('customfield_13834',value)