Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,458,309
Community Members
 
Community Events
176
Community Groups

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

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

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

Hi john,

which add-on is used to do this.

John Funk Community Leader Jan 02, 2020

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

John Funk Community Leader Jan 02, 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 Jan 02, 2020

Never mind, this is a discussion lol

Comment

Log in or Sign up to comment