Only Show Smart Label if Linked Issue(s) are Open

Ron B
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 17, 2024

For an Issue List Widget, I currently have the following Custom JQL:

(issuekey in childIssuesOf("Release Management ####")) and type not in ("Subtest", Epic) AND status NOT IN (closed)

For the Smart Labels, I have the following:

Blocks: (issuekey in childIssuesOf("Release Management ####")) AND issueLinkType IN (blocks)

Blocked By: (issuekey in childIssuesOf("Release Management ####")) AND issueLinkType IN (is blocked by)

The problem is, if there are any open linked items, then the smart label shows. For each card in the list, and for each individual label, what I would like is that the label will not show if all of the linked items are closed. For example, if all of the linked items that are marked as Blocked By as Closed, then the Blocked By label should not show.

 

1 answer

0 votes
Humashankar VJ
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.
November 4, 2024

Hi @Ron B 

To address this, ScriptRunner's custom JQL can be employed for smart labels. Two examples include:

For "Blocks" smart labels:

issuekey in childIssuesOf("Release Management ####") AND issueLinkType IN (blocks) AND issuekey IN linkedIssuesOf("status != Closed", "is blocked by")

For "Blocked By" smart labels:

issuekey in childIssuesOf("Release Management ####") AND issueLinkType IN (is blocked by) AND issuekey IN linkedIssuesOf("status != Closed", "blocks")

 

The linkedIssuesOf() function checks issues linked by a specified type, matching conditions like non-Closed status. These JQL statements ensure smart labels appear only when open linked issues match the specified link type.

As JIRA's native JQL limitations, which lacks the support for subqueries and dynamic status checks for linked issues. To get rid try ScriptRunner or similar plugins for advanced queries. The linkedIssues() function, for instance, only returns issue keys without enabling status filtering within a single query.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

 

Suggest an answer

Log in or Sign up to answer