How to transition parent Issue using SIL script when the child linked issues changed with another status

AkashD August 5, 2016

Hello,

I have Jjupin Plugin installed on JIRA 7.1 and want to try auto transition the issue as per validation on linked issues.

Example:- I have parent issue type like (Story Task) and it has multiple child issue type (Task) which are linked to the parent (Story Task)  both the issue types (Parent & Child) having different Workflows and I want to auto transition the Parent (Story Task) as per the status changed on all Linked issue (Task)

 

Here I am giving example I am using in SIL

 

Please assist how do I achieve this using SIL program with step by step configuration

if(isNull(parent)) {
if (issueType == "Task") {
    string [] linkedIssues = linkedIssues(key, "relates to");
    for(string linked in linkedIssues) {
    if(%linked%.status == "Design Completed") {
       return;
}
}
}
autotransition("Design Completed", parent);
}

2 answers

0 votes
AkashD August 9, 2016

Hello Ligia,

In my scenario, all the  child are Linked issue I am not using as parent-child (subtask)

 

All the relation is for Link issue i need to transition the main issue which is depends on linked issue it has.

 

0 votes
Ligia Merciu August 7, 2016

Hi Akash,

It is a little bit confusing for me: do you have a parent issue and some children issues (like subtasks), or an issue and some dependent issues (linked with "relates to")?

The "parent" standard variable works only for subtasks. To identify the subtasks of an issue, you have to use "subtasks(<issuekey>)" instead of linkedIssues.

 

AkashD August 9, 2016

Hello Ligia,

I need to change the status of Linked Issue which has Link "relates to" 

Example :- I have 3 project P1, P2 and P3

P1- issue type (UC story)

p2- issue type (UC story task)

p3- isue type (Task)

and the relations are 

Linked p1–> p2–>p3

If ALL p3 issues are closed auto transition the p2 status to Closed and then auto transition the p1 status to closed

,Here is my updated script I am running this script as post function on transition (Closed) to every linked issue transitions

 

string sk;
bool allclosed = true;
string[] mylinarray = linkedIssues(key);
for (sk in mylinarray) {
if (%sk%.status != "Closed") {
allclosed = false;
}
}
if(allclosed) {
autotransition(Closed, %mylinarray%, true);
}

Suggest an answer

Log in or Sign up to answer