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

Compare with Current View Page History

« Previous Version 10 Next »

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)

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.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 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.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 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.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 minimumNumber is the respective minimum number of sub-tasks which are linked to the issue).

Add this expression with && to the existing one.

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 maximumNumber is the respective maximum number of sub-tasks which are linked to the issue).

Add this expression with && to the existing one.

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
  • Depending on the previous selected options, different actions have to be taken:

    • In case nothing had been selected in the respective filter, skip the part of the condition which is described for the respective parameter (nothing has to be done) 
    • In case one or more filters have been selected, enclose the current CONDITION in brackets and add

      ||
      ! the part of the condition of the respective filter

      afterwards.

          If more than one of the options is selected, add such a negation for each of the filters.

  • if minimum/maximum number are changed, add an expression with a condition which reflects the original filter (and is described there) and concatenate the two by &&:

    issue.subtasks.filter(issue=>
    CONDITION).length comparison minimum/maximum // comparison: >= or <=
    && 
    issue.subtasks.every(issue=> CONDITION)

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.
Allow unselected statuses, Allow unselected resolutions are checked.

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 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
Additional options

Check

Allow unselected issue types

Allow unselected statuses

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

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
Additional options

Check

Allow unselected issue types

Allow unselected resolutions

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

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
Additional options

Check

Allow unselected issue types

Allow unselected statuses

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.