Hi,
I have sub tasks set up as approval tasks, if some is the transition the sub task to rejected status I want to update all the other sub-task status to cancelled.
I'm still very new to SIL Scripting and JIRA in general.
Currently using cloud JIRA
I have searched CPrime documentation and Atlassion community and can't see anything that is using something simiilar
Current code is bring back incompatible array error. Any help much appreciated
//get all subtasks
string s_tasks=subtasks(key);
for(string s in s_tasks){
//if subtask not rejected and not in resolution not done
if (%s%.status != "Rejected" || %s%.resolution != "Done")
return;
for(string s in subtasks(key)) {
%s%.status = "Cancelled";
}
}
}
Hello,
Your script should look like this:
string [] s_tasks=subtasks(key);
for(string s in s_tasks){
//if subtask not rejected and not in resolution not done
if (%s%.status != "Rejected" || %s%.resolution != "Done")
return;
for(string s in subtasks(key)) {
autotransition("Cancel", %s%);
}
}
I was thinking about it a different way, don't think I would have got the update using transition rather than status directly.
Couple of questions, firstly is it always better to use the transition to update status or is there some instances where you would update the status directly?
Secondly, as as i am using cloud I need to use the transition id for autotranstion, do I need use the status id as well?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I've tried your code its not updating the other subtasks. Added a comment so I know its firing
addComment(key, currentUser(), "Approval Rejected");
string [] s_tasks=subtasks(key);
for(string s in s_tasks){
//if subtask not rejected and not in resolution not done - 10026 is rejected status
if (%s%.status != 10026 || %s%.resolution != "Done")
return;
for(string s in subtasks(key)) {
autotransition(21, %s%);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kindly open a ticket in our service desk portal:
https://jira.cprime.io/servicedesk/customer/portal/2/user/login?destination=portal%2F2
The Service Desk will be able to see the logs from your Cloud Instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.