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

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

Suggest an answer

Log in or Sign up to answer