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

May I link a issue to the other when this issue created by groovy script

Fanglin Shu March 3, 2015

  help  !  help!    I   want  to  link a  issue to the other  when  this  issue created by using  the  groovy runner I 

 is  anybody  has a  script >?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Begoña Bonet March 3, 2015

Hi Fanglin Shu,

 

The next code works for me:

 

// Create the new issue
Issue newIssue = issueManager.createIssueObject(admin, newMutableIssue);

if(newIssue == null) {
log.error("error creating new issue");
}
else {
// Set link
IssueLinkType iLinkType = findIssueLinkTypeByName(ISSUE_LINK_TYPE_NAME);

if(iLinkType == null) {
log.error("IMPOSSIBLE TO LINK ISSUE " + myIssue.getKey());
}
else {
issueLinkManager.createIssueLink(myIssue.getId(), newIssue.getId(), iLinkType.getId(), Long.valueOf(0), admin);
}
}

Fanglin Shu March 3, 2015

thanks!

TAGS
AUG Leaders

Atlassian Community Events