Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,424
Community Members
 
Community Events
165
Community Groups

How Should I implement Links validator in Jira cloud?

Edited

"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 May 04, 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>

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

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you