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

Compare with Current View Page History

« Previous Version 9 Next »

The  Condition on linked issues of JWT DC is not yet available in JWT Cloud but can be implemented easily using a Jira expression condition.

Migration steps

Build a matching  Jira expression by migrating the parameters of the Condition on linked issues using this template:

let LT = [];
let ITI = [];
let SI = [];
let RI = [];
let FVE = (issue => issue);
let MI = 0;
let MA = 1000;
let ITA = false;
let SA = false;
let RA = false;
let FVEA = false;
 
let CON = (issue => (
    (LT.length == 0 || link.direction == "outward" ? LT.includes(link?.type?.outward):LT.includes(link?.type?.inward) &&
    (ITI.length == 0 || ITI.includes(issue?.issueType?.name)) &&
    (SI.length == 0 || SI.includes(issue?.status?.name)) &&
    (RI.length == 0 || RI.includes(issue?.resolution?.name)) &&
    FVE(issue)
));
 
issue.subtasks.filter(CON).length >= (MI ? MI : 0)
&& issue.subtasks.filter(CON).length <= (MA ? MA : 1000)
&& issue.subtasks.every(issue => (
    CON(issue) ||
    (LT && !(link.direction == "outward" ? LT.includes(link?.type?.outward):LT.includes(link?.type?.inward)) ||
    (ITA && !ITI.includes(issue?.issueType?.name)) ||
    (SA && !SI.includes(issue?.status?.name)) ||
    (RA && !RI.includes(issue?.resolution?.name)) ||
    (FVEA && !FVE(issue))
))

The following table shows how to obtain the individual components of the resulting Jira expression.

Migration details

JWT DC
  

JWT DC option

JWT Cloud

Notes
Filter by link type
In line 1, add the issue link type names to be filtered to the list.

Example:

let LT = ["blocks"];
Filter by issue type

In line 2, add the issue type names to be filtered to the list.

Example:

let ITI = ["Submission", "Mail"];
Filter by status

In line 3, add the status names to be filtered to the list.

Example:

let SI = ["In Progress", "To Do"];
Filter by resolution

In line 4, add the resolution names to be filtered to the list.

Example:

let RI = ["Won't do", "Duplicates"];
Filter by field value

In line 4, adopt the function according to your needs by adding the respective Jira expression. It has to return a logical value. A list of field codes can be found in Field codes. For more information about Jira expression, please have a look at Atlassian's documentation.

Examples:

let FVE = (issue => issue?.attachments?.length >0 )
let FVE = (issue => issue?.project.key == 'PRJ' )
Minimum number of sub-tasks

In line 6, change the minimum number of sub-tasks if necessary (the default is set to 0)

Example:

let MI = 3
Maximum number of sub-tasks

In line 7, change the maximum number of sub-tasks if necessary (the default is set to1000)

Example:

let MA = 5

Additional options


Allow unselected issue types

In line 8, change the value to true, if you want to allow unselected issue types.

Example:

let ITA = true;
Allow unselected statusesIn line 9, change the value to true, if you want to allow unselected statuses.

Example:

let SA = true;
Allow unselected resolutionsIn line 10, change the value to true, if you want to allow unselected resolutions.

Example:

let RA = true;
Allow unsatisfied field value filterIn line 11, change the value to true, if you want to allow an unsatisfied field value filter.

Example:

let FVEA = true;

Examples

JWT DC parameter valuesJira expression

Use case There must be at least one related Service Management request

ParameterValue
Filter by issue link typeempty
Filter by issue typeempty
Filter by statusempty
Filter by resolutionempty
Filter by projectAny project
Filter by field value%{seed.issue.project.category} = "Service Management"
Minimum number of linked issues1
Maximum number of linked issuesleave the default value 1000 unchanged
Additional options

Check

Allow unselected issue types

Allow unselected statuses

let LT = [];
let ITI = [];
let SI = ["Closed"];
let RI = ["Done"];
let FVE = (issue => issue);
let MI = 0;
let MA = 1000;
let ITA = true;
let SA = true;
let RA = false;
let FVEA = false;
....
issue.links.filter(link=> link?.linkedIssue?.project?.projectCategory?.name == "Service Management").length>=1

Use case Prevent transitioning when there is a blocking issue

ParameterValue
Filter by issue link typeis blocked by
Filter by issue typeempty
Filter by statusResolved, Closed
Filter by resolutionempty
Filter by project

CRM

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.links.every(link=>
   link.direction == "outward" ? 
   ["is blocked by"].includes(link.type.outward):
   ["is blocked by"].includes(link.type.inward)
&& 
   ["Resolved","Closed"].includes(link?.linkedIssue?.status?.name)
&&
   ["CRM"].includes(link?.linkedIssue?.project?.name))

Use case All blocking issues must be resolved

ParameterValue
Filter by issue link typeis blocked by
Filter by issue typeempty
Filter by statusempty
Filter by resolutionFixed, Done
Filter by projectAny project
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 link types

Allow unselected issue types

Allow unselected statuses

issue.links.every(link=>
  ( link.direction == "outward" ? 
   ["is blocked by"].includes(link.type.outward):
   ["is blocked by"].includes(link.type.inward)
&& 
   ["Fixed","Done"].includes(link?.linkedIssue?.resolution?.name))
|| 
  !link.direction == "outward" ? 
   ["is blocked by"].includes(link.type.outward):
   ["is blocked by"].includes(link.type.inward)

Due to the different architecture, it may happen that the condition gets too complex. This is the case when many fields are checked. The condition cannot be saved, and a corresponding error message will be displayed. If that's the case, the condition has to be split up into two or more. 


If you still have questions, feel free to refer to our support team.