Hi,
need to check in the condition if sub-task of specific type already exist.
If exist, transition is not allowed.
I ended with
issue.get("subtasks")?.any{it.getIssueType().getName() != "Server Config IP"}
which is working, but only for checking the first one in array
If the subtask is not first in the array, its always true.
Hi @Tomáš Vrabec ,
your code actually tests if any subtask is not of type "Server Config IP". Replace != with == and you'll get the desired result.
Hi @David Fischer its intended.
Attaching screen of transitions in workflow.
Each transition generating different sub-task type.
Each transition got the same mentioned condition.
When I create "Server Config IP" subtask, first transition is hiding as expected.
When I create all of three others, transitions are still shown, even condition is very the same, just with different getName comparison.
Working on workaround via custom fields, but still this would be nicer solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I understand correctly, you want each transition to be visible (available) only if there is no corresponding subtask, correct? In that case, your condition should be:
!issue.get("subtasks")?.any{it.getIssueType().getName() == "Server Config IP"}
(note the leading ! and the ==)
which means "there is no subtask whose issue type is Server Config IP"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, that did the job. Thanks David and have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Definitelly @David Fischer will know the answer, just posted it here so others can found it in future.
(and me as well) :-)
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.