I am trying to set single select custom field in post-fuction, but I don't have much luck.
We are using still old Scriptrunner 6.55 and the examples on the web don't exactly work. Documentation does not have an example for single select.
I currently use this code to update a date field, which works, but I am not able to figure out how to update single select field.
import com.atlassian.jira.component.ComponentAccessor
import java.sql.Timestamp
def projectComponentManager = ComponentAccessor.getProjectComponentManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
// a date time field
def dateCf = customFieldManager.getCustomFieldObject("customfield_21303") // Date time fields require a Timestamp
issue.setCustomFieldValue(dateCf, new Timestamp((new Date()).time))
Anyone can help?