Is there a way to check on an issue's status using the haslink function

Ishan Banerjee
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!
April 21, 2023

For any Jira that is blocked by another team's Jira , we are using the haslink function and if the linked JIra is "is blocked by" then based on the status of the blocker Jira we would like to show our Jira to be as BLOCKED. 

So if the blocker Jira is in Open, In progress , in review etc state then it is still BLOCKING but once the blocking Jira has been CLOSED or RESOVLED then the blocker is considered as not a blocker however team doesn't want to just remove the issuelink as it will be used for references.

 

 something like this : 

project = "PXYZ" AND (issueFunction in hasLinks("is blocked by") AND issuelinkstatus not in (Closed, Resolved))

 

3 answers

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

Hello @Ishan Banerjee 

Welcome to the Atlassian community!

Are you working with Jira Cloud or Jira Server/Data Center?

Do you have any third party apps that extend JQL functionality, like Adaptavist ScriptRunner or JQL Tricks?

1 vote
Dan Breyen
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.
April 24, 2023

Hi @Ishan Banerjee welcome!  You don't say whether or not you are on the Cloud with your system or not.  If you are on the Cloud, you should be able to accomplish this with Automation.  I'm no expert on it, but in your project with the child (linked) issue, you should be able to see when the status changes and then update the Parent Status accordingly.  

0 votes
Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2023

@Ishan Banerjee From your example JQL query, it seems that you are already using ScriptRunner for Jira add-on (since you have used the keyword "issueFunction" and the JQL function "hasLinks()", which are normally used in ScriptRunner).

Based on my knowledge of ScriptRunner, I think in your case, "linkedIssuesOf()" function will suit your needs since this function supports a JQL subquery and a link description as parameters. You can read more about the usage of this function in ScriptRunner add-on's documentation and use it to see it it solves your problem. It would be roughly like this:

project = "blocked-project-name" AND issueFunction in linkedIssuesOf("project = 'blocking-project-name' and status not in (Closed, Resolved)", "blocks") order by created DESC

Hope this helps!

Suggest an answer

Log in or Sign up to answer