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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you