want update a custom field with number type base on another custom field with number type
I want to do this with script runner listener but do not work correctly,
for example for number1 and number2 this is my code :
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
def issue = event.issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def number1 = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "number1"}
def number2 = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "number2"}
def changeHolder = new DefaultIssueChangeHolder()
number1.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(number1), number2),changeHolder)