how to move summary of one issue to summary of other linked issue

Bhavani kandukuri December 31, 2019

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)
}

 

2 comments

Bhavani kandukuri December 31, 2019

I have tried another way also

import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.component.ComponentAccessor;

def issue = event.issue
def summary
if(issue.issueType.name == 'Onboarding-HR Initiated'){
summary = issue.getSummary().toString()
}
log.warn('summary' + summary)
if(issue.issueType.name == 'Onboarding-Manager Submitted'){
log.warn('Onboarding-Manager Submitted ' + summary)
def im = ComponentAccessor.getIssueManager();
def issueToChange = im.getIssueObject(issue.id) as MutableIssue
issueToChange.setSummary(summary.toString())   //SUMMARY value coming NULL here

}

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 31, 2019

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.  :-)

Bhavani kandukuri January 1, 2020

Hi john,

which add-on is used to do this.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 2, 2020

We use the Automation For Jira add-on. It works great. 

Bhavani kandukuri January 2, 2020

ok thankQ

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 2, 2020

If that solved what you needed, can you click on the Accept answer button above to close this out? Thanks!

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 2, 2020

Never mind, this is a discussion lol

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events