The condition Condition on sub-tasks is not yet available in JWT Cloud, but you can implement it using the Jira expression condition.
Create a Jira expression condition.
Create a Jira expression by migrating the parameters of the Condition on sub-tasks
The resulting Jira expression will be assembled where the most common form is the following:
issue.subtasks.every(issue=> CONDITION )
CONDITION denotes the condition which is built based on the parameters and options from JWT DC. Migrate them as described in the following table.
JWT DC | JWT DC option | JWT Cloud | Notes |
---|---|---|---|
Filter by issue type | If the current CONDITION is empty, add [listOfIssueTypeNames].includes(issue?.issueType?.name) listOfIssueTypeNames is the text list of the issue types which have to be filtered, e.g. "Submission","Mail") If the current CONDITION is not empty, precede this expression by | Examples issue.subtasks.every(issue=> ["Submission","Mail"].includes(issue?.issueType?.name)) issue.subtasks.every(issue=> ["Done"].includes(issue?.resolution?.name) && ["Submission","Mail"].includes(issue?.issueType?.name)) | |
Filter by status | If the current CONDITION is empty, add [listOfStatusNames].includes(issue?.status?.name) to it (where If the current CONDITION is not empty, precede this expression by | Examples issue.subtasks.every(issue=> ["In Progress","To Do"].includes(issue?.status?.name)) issue.subtasks.every(issue=> ["Submission","Mail"].includes(issue?.issueType?.name) && ["In Progress","To Do"].includes(issue?.status?.name)) | |
Filter by resolution | If the current CONDITION is empty, add [listOfResolutionNames].includes(issue?.resolution?.name) to it (where If the current CONDITION is not empty, precede this expression by | Examples issue.subtasks.every(issue=> ["Won't do","Duplicates"].includes(issue?.resolution?.name)) issue.subtasks.every(issue=> ["Mail"].includes(issue?.issueType?.name) && ["Won't do","Duplicates"].includes(issue?.resolution?.name)) | |
Filter by field value | If the current CONDITION is empty, add a Jira expression to it which returns a logical value according the JWT expression from JWT DC. If the current CONDITION is not empty, precede this expression by | Example issue.subtasks.every(issue=> ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 ) | |
Minimum number of sub-tasks | Copy the current expression, replace every by filter and add .length>= minimumNumber to it (where Add this expression with If the current CONDITION is empty, replace the whole expression by issue.subtasks.length>= minimumNumber | Examples: issue.subtasks.filter(issue=> ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 ).length>=3 issue.subtasks.length>=3 Filter by status and Maximum number are set: issue.subtasks.filter(issue=>( ["Done"].includes(issue?.status?.name)).length<=3 && issue.subtasks.every(issue=> ["Done"].includes(issue?.status?.name)) | |
Maximum number of sub-tasks | Copy the current expression, replace every by filter and add .length<= maximumNumber to it (where Add this expression with If the current CONDITION is empty, replace the whole expression by issue.subtasks.length<= maximumNumber In case the minimum number is also set, you have to repeat the expression and concatenate it by the AND operator issue.subtasks.filter(issue=> (CONDITION) ) >= minimumNumber && issue.subtasks.filter(issue=> (CONDITION) ) <= maximumNumber | Examples: issue.subtasks.filter(issue=> ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 ).length<=3 issue.subtasks.length<=3 Minimum number and maximum number of sub-tasks are set: issue.subtasks.filter(issue=>( ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 )).length>=3 && issue.subtasks.filter(issue=> ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 ).length<=5 Filter by issue type and Maximum number are set: issue.subtasks.filter(issue=>( ["Mail"].includes(issue?.issueType?.name)).length<=3 && issue.subtasks.every(issue=> ["Mail"].includes(issue?.issueType?.name)) | |
Additional options | Allow unselected issue types |
| Examples: Filter by issue type and Filter by status are set, Allow unselected issue types, Allow unselected resolutions checked issue.subtasks.every(issue=> (["Mail"].includes(issue?.issueType?.name) && ["In Progress","To Do"].includes(issue?.status?.name)) || !["Mail"].includes(issue?.issueType?.name)) Filter by issueType and Minimum number of the sub-tasks are set. issue.subtasks.filter(issue=> ["Test case"].includes(issue?.issueType?.name)).length>=3 && issue.subtasks.every(issue=> ["Test case"].includes(issue?.issueType?.name)) |
Allow unselected statuses | |||
Allow unselected resolutions | |||
Allow unsatisfied field value filter |
Examples
JWT DC parameter values | Jira expression | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use case All sub-tasks in the Closed status must have a specific resolution
| issue.subtasks.every(issue=> ( ["Closed"].includes(issue?.status?.name) && ["Done"].includes(issue?.resolution?.name)) || !["Closed"].includes(issue?.status?.name) ) Minimum and maximum values are ignored here as they have the meaning "all sub-tasks". | ||||||||||||||||
Use case Close parent issue only when all sub-tasks are closed
| issue.subtasks.every(issue=> ["Closed,Done"].includes(issue?.status?.name)) Minimum and maximum values are ignored here as they have the meaning "all sub-tasks". | ||||||||||||||||
Use case An issue must have at least 3 resolved Test Cases
| issue.subtasks.filter(issue=> ["Test case"].includes(issue?.issueType?.name) && ["Done"].includes(issue?.resolution?.name) ).length>=3 && issue.subtasks.every(issue=> ["Done"].includes(issue?.resolution?.name) ) Maximum value is ignored here as it has the meaning "all sub-tasks". |
Due to the different architecture, it may happen that the condition gets too complex. The condition cannot be saved and a corresponding error message will be displayed. Split the condition into two or more.
If you still have questions, feel free to refer to our support team.