How Should I implement Links validator in Jira cloud?

vishal kanoujiya May 4, 2022

"This validator checks that there are no linked issues in set statuses".

This is requirment of links validator. How Should I implement in jira cloud?

2 answers

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2022

Hi @vishal kanoujiya 

In my history, I've typically made use of a combination of a field and automation.  For example, let's say that I don't want the ability to close an issue if any blocked by links remain in an open status:

Use a field, component, or label to serve as your anchor.  I typically use a custom field:

AUTOMATION 1 - Setting the custom field

  • TRIGGER: Issue linked
  • CONDITION:  Any conditions you want for your linked status
  • ACTION: Edit issue
    • Set field to something

AUTOMATION 2 - Clearing the custom field

  • TRIGGER: Issue transitioned to whatever status you're looking for
  • BRANCH: Linked Issues (e.g. blocks, clones, etc.)
    • ACTION: Edit issue
      • Set field to the "all clear"

WORKFLOW Validator

  • Field value != <field value set in Automation 1>
Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2022

It never occurred to me to use Automation like this. Thank you, that's a really fascinating approach :) 

0 votes
Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2022

Hi @vishal kanoujiya ,

While I like @Mark Segall's approach of using Automations and a built-in Validator, I would like to offer a Jira Expressions based alternative. 

Jira Expressions are a JavaScript-like language you can use in Jira Cloud that allows you to build almost every kind of validator you want. However, you'll need one of the many great workflow apps that support them.

Now, let's quickly build a validator that ensures that no linked issues are in the status 'Backlog':

issue
.links
.filter( i => i.inwardIssue.status.name == "Backlog")
.length == 0

If at least one of the linked issues is in the status "Backlog", this validator returns false. And you can just as easily expand this a bit to filter only for specific link types:

issue
.links
.filter(t => t.type.name == "Blocks")
.filter( i => i.inwardIssue.status.name == "Backlog")
.length == 0

A final – and in my mind the biggest – benefit of using an expressions based validator in this situation, is that it keeps all configuration information within the workflow. With the Automation-based approach, there's always to places to look, when you want to understand what's going on. 

Anyway, I hope that helps, 
 Oliver

Suggest an answer

Log in or Sign up to answer