The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy assignee from parent link to child?

NewByatl
Contributor
November 28, 2022

Greeting! I'm trying to copy assignee from parent link ("is Parent of") to child("is Child of") by SIL listener

Help me pls to fix this script.

My script looks like this:

if(project == "AISRITS" && issueType == "Requirement"){
JIssueLink[] jIssueLinks = getIssueLinksDetail(key);
string assignee;
string papa = linkedIssues(key, "Parent");
string nepapa = linkedIssues(key, "Child");

for(JIssueLink jIssueLink in jIssueLinks){
if(jIssueLink.issue.issueType == "Sub-Requirement" &&
jIssueLink.description == "is Child of"{
//jIssueLink.description == "is Parent of"{
nepapa.assignee = papa.assignee;

}

}
}1.PNG2.PNG

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jeroen Poismans
Community Champion
February 14, 2023

Hi!

Does your script throw an error or does it do something different then you want.

Regardless, it still contains a syntax error. You are missing a ) after "is Child of". So to run the code should be:

if (project == "AISRITS" && issueType == "Requirement") {
   JIssueLink[] jIssueLinks = getIssueLinksDetail(key);
string assignee;
string papa = linkedIssues(key, "Parent");
string nepapa = linkedIssues(key, "Child");

for (JIssueLink jIssueLink in jIssueLinks) {
if (jIssueLink.issue.issueType == "Sub-Requirement" &&
jIssueLink.description == "is Child of") {
nepapa.assignee = papa.assignee;
}
}
}

 Hope this helps!

Jeroen