You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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)

to it (where 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 listOfStatusNames is the text list of the status names which have to be filtered, e.g. "In Progress","To Do"

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 listOfResolutionNames is the text list of the resolution names which have to be filtered, e.g. "Won't do","Duplicate"

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 minimumNumber is the respective minimum number of sub-tasks which have to fulfill the condition)


Maximum number of sub-tasks

Add

.length<= maximumNumber

to the Jira expression (where maximumNumber is the respective maximum number of sub-tasks which have to fulfill the condition)


Additional optionsAllow unselected issue typesSkip the part of the condition which is described for the parameter Filter by issuetype.
Allow unselected statusesSkip the part of the condition which is described for the parameter Filter by Status.
Allow unselected resolutionsSkip the part of the condition which is described for the parameter Filter by resolution.
Allow unsatisfied filed value filterSkip the part of the condition which is described for the parameter Filter by field value.

Examples

tbd

JWT DC parameter valuesJira expression

Use case All sub-tasks in the Closed status must have a specific resolution

ParameterValue
Filter by issue typeempty
Filter by statusClosed
Filter by resolutionDone
Filter by field valueempty
Minimum number of sub-tasksleave the default value 0 unchanged
Maximum number of sub-tasksleave the default value 1000 unchanged
Addiotinal options

Check

Allow unselected issue types

Allow unselected statuses

issue.subtasks.filter(issue=> ["Done"].includes(issue?.resolution?.name) )

Use case Close parent issue only when all sub-tasks are closed

ParameterValue
Filter by issue typeempty
Filter by statusClosed, Done
Filter by resolutionempty
Filter by field valueempty
Minimum number of sub-tasksleave the default value 0 unchanged
Maximum number of sub-tasksleave the default value 1000 unchanged
Addiotinal options

Check

Allow unselected issue types

Allow unselected resolutions

issue.subtasks.filter(issue=> ["Closed,Done"].includes(issue?.status?.name) )

Use case An issue must have at least 3 resolved Test Cases

ParameterValue
Filter by issue typeTest case
Filter by statusempty
Filter by resolutionDone
Filter by field valueempty
Minimum number of sub-tasks3
Maximum number of sub-tasksleave the default value 1000 unchanged
Addiotinal options

Check

Allow unselected statuses

issue.subtasks.filter(issue=> ["Test case"].includes(issue?.issueType?.name) 
&& ["Done"].includes(issue?.resolution?.name) ).length>=3