I have used the clone functionality to clone a JIRA if a certain condition is met, however how do I set that a custom user select field is defaulted to a particular user only for the cloned JIRA.
Below is the current syntax
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.manager.OptionsManager
def optionsManager = ComponentAccessor.getComponent(OptionsManager)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
// set Scrap field to Yes
def scrapCf = customFieldManager.getCustomFieldObjectByName("POD")
def fieldConfig = scrapCf.getRelevantConfig(issue)
def option = optionsManager.getOptions(fieldConfig).getOptionForValue("Transaction", null)
issue.setCustomFieldValue(scrapCf, option)
checkAttachment = {attachment -> false};
issue.assigneeId = null;
issue.summary = "[Reporting]-"+ transientVars["issue"].summary;
import com.onresolve.scriptrunner.runner.util.UserMessageUtil
UserMessageUtil.success('Backreporting Ticket created.')
When i add, the below to it, it doesn't work:
def validatingUser = getFieldByName("Ticket Owner")
validatingUser.setFormValue("stanme")
Can anyone help?