Hello ,
We are Having scripted custom field with type single issue picker which contains drop down of other issues.
We need automatically move that field value to the summary. We worked around some code through listeners but it is taking the only "HR-125" but it is not reading the rest of the text. Could you please help us to achieve that at least we don't need that HR-125 our target is that only the text besides that key has to replaced.
Please find below code which you are using through listener
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.fields.CustomField;
import groovy.json.JsonSlurper
def eventIssue = event.issue
if(eventIssue.issueType.getName() == 'Onboarding-Manager Submitted'){
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField EmployeeName = customFieldManager.getCustomFieldObject("customfield_11602");
//Employee name customfield_11601 of Onboarding-HR Initiated
def summaryValue;
def cfv1 = eventIssue.getCustomFieldValue(EmployeeName);
log.warn('EmployeeName '+cfv1)
if(cfv1)
{ summaryValue = cfv1 }
def im = ComponentAccessor.getIssueManager();
log.warn('EmployeeName TETE '+summaryValue.toString())
def issueToChange = im.getIssueObject(eventIssue.id) as MutableIssue
issueToChange.setSummary(summaryValue.toString())
//def im = ComponentAccessor.getIssueManager();
//def issueToChange = im.getIssueObject(issue.id) as MutableIssue
