Hi! Im newbie in ScriptRunner so I need some help. I have to set moving numeric value from customfield1 to customfield2 on workflow transition. This value must be editable. Below I pass my code. This code is copiled okey, but I dont see any changes on issue.
Regards and Thanks!!!
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
//import com.atlassian.jira.issue.CustomFieldManager
//import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def customFieldManager = ComponentAccessor.customFieldManager
// the name of the custom field to update
def customFieldName = 'Cost'
def fundingFieldName = 'Funding'
def fundingField = customFieldManager.getCustomFieldObjects(issue).findByName(customFieldName)
def customField = customFieldManager.getCustomFieldObjects(issue).findByName(customFieldName)
// the new value of the field
def newValue = customField.getValue(issue)
fundingField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(fundingField), newValue), new DefaultIssueChangeHolder())