Hi.
i have a linked issues
After creation of first ticket we need to take the summary into that second ticket.
i tried with scripting.but it is not effecting.can anyone suggest on this plz
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
import com.atlassian.jira.event.issue.IssueEvent
def issue = event.issue
if(issue.issueType.name == 'Onboarding-Manager Submitted'){
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField EmployeeName = customFieldManager.getCustomFieldObject("customfield_11601");
//Employee name customfield_11601 of Onboarding-HR Initiated
log.warn('EmployeeName'+EmployeeName)
String summaryValue;
def cfv1 = issue.getCustomFieldValue(EmployeeName);
if(cfv1){
summaryValue = cfv1
}
def im = ComponentAccessor.getIssueManager();
def issueToChange = im.getIssueObject(issue.id) as MutableIssue
issueToChange.setSummary(summaryValue)
//def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
//def userManager = ComponentAccessor.getUserManager();
//def user = userManager.getUserByName(currentUser.name)
//im.updateIssue(user, issueToChange, EventDispatchOption.DO_NOT_DISPATCH, false)
}
Hi @Bhavani kandukuri - Welcome to the Atlassian Community!
I have been able to do that with the Automation For Jira add-on. It's point and click for the most part and no scripting. :-)
We use the Automation For Jira add-on. It works great.
If that solved what you needed, can you click on the Accept answer button above to close this out? Thanks!
Never mind, this is a discussion lol