Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

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.PNG 2.PNG

1 answer

0 votes
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 14, 2023 edited

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