Forums

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

Script to change the sub task status to hold when parent issue is changed to hold

Pravin Awati July 1, 2019

Hi can some one help with script which will change the status of all subtask on hold when

status of parent issue changed to hold  using the script runner 

 

i need to add this is on post function script

 

thanks 

1 answer

0 votes
Vimalraj
Contributor
July 1, 2019

@Pravin Awati Below is the SIL script that needs to be called in the "Hold" post function to move all sub task to hold. Hope it helps.

string cuser = currentUser();
runAs(cuser);
string issuekeyy = key;
string [] alltasks = subtasks(issuekeyy);
string singleid;

for(singleid in alltasks)
{
string typeissue;
string substate;
typeissue = %singleid%.key.issueType;
substate = %singleid%.key.status;
if (%singleid%.key.status != "Hold")
{
autotransition("Hold",singleid, true, true, true);
}
}

Pravin Awati July 3, 2019

Hi Vimal thanks for your answer but unfortunately  its is giving error at % saying unexpected token at below line

typeissue = %singleid%.key.issueType;

 

(i am using this script at script runner )

 

Thanks 

Vimalraj
Contributor
July 3, 2019

@Pravin Awati This is a SIL script. You need Power scripts plugin. I haven't tried performing the request in Script runner. Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events