The condition Condition on sub-tasks is not yet available in JWT Cloud, but you can implement it easily using the Jira expression condition.
Create a Jira expression condition
You then have to create a Jira expression by transforming the parameters of the Condition on sub-tasks
The resulting Jira expression has the form
issue.subtasks.filter(issue=> CONDITION )
CONDITION denotes the condition which is built based on the parameters and options from JWT DC. They are migrated as described in the following table.
JWT DC | JWT DC option | JWT Cloud | Notes |
---|---|---|---|
Filter by issuetype | 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.filter(issue=>["Submission","Mail"].includes(issue?.issueType?.name)) issue.subtasks.filter(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.filter(issue=> ["In Progress","To Do"].includes(issue?.status?.name)) issue.subtasks.filter(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.filter(issue=> ["Won't do","Duplicates"].includes(issue?.resolution?.name)) issue.subtasks.filter(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 | issue.subtasks.filter(issue=> ["Mail"].includes(issue?.issueType?.name) && issue?.attachments?.length >0 ) | |
Minimum number of sub-tasks | Add .length>= minimumNumber to the Jira expression (where | ||
Maximum number of sub-tasks | Add .length<= maximumNumber to the Jira expression (where | ||
Additional options | Allow unselected issue types | Skip the part of the condition which is described for the parameter Filter by issuetype. | |
Allow unselected statuses | Skip the part of the condition which is described for the parameter Filter by Status. | ||
Allow unselected resolutions | Skip the part of the condition which is described for the parameter Filter by resolution. | ||
Allow unsatisfied filed value filter | Skip the part of the condition which is described for the parameter Filter by field value. |
Examples
tbd
JWT DC parameter values | Jira expression | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use case All sub-tasks in the Closed status must have a specific resolution
| issue.subtasks.filter(issue=> ["Done"].includes(issue?.resolution?.name) ) | ||||||||||||||||
Use case Close parent issue only when all sub-tasks are closed
| issue.subtasks.filter(issue=> ["Closed,Done"].includes(issue?.status?.name) ) | ||||||||||||||||
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 |