Hi,
I'm trying to add Groovy expression to run the post function only if all subtasks with type Approval are in status approved or cancelled.
any idea how can i write this condition?
Hi @Fadi I. Shahwan ,
I believe this is what you're looking for:
issue.subTaskObjects.every{it.get("issuetype").name != "Approval" || it.get("status").name in ["Approved", "Cancelled"]}
Thank David
It partially working
in my case I have an sub task type "Approval" if any of these approvals are not approved or cancelled then it should be fail. (this is working fine)
issue.subTaskObjects.every{it.get("issuetype").name == "Approval" && it.get("status").name in ["Approved", "Cancelled","Conditional Approval"]}
However when i created another type or sub tasks under the same issue it fail as it is checking the other sub tasks statuses not only the approval sub task. I need it to check only approval sub tasks and status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fadi I. Shahwan did you try the code I offered, which is different from the one you seem to have tried?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Apologize, it is working fine.
Thanks for your support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fadi I. Shahwan ,
Do you mean all sub-tasks with issue type name as "Approval" have to be in specific statuses? Or is "Approval" any other customfield value?
Thanks,
Anjali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.