Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL for issueLinkType="blocks"

Brad B
Contributor
November 20, 2019

Hey,

For a test, I have two issues: Issue One and Issue Two.  Issue Two "is blocked by" Issue One, by creating a link between those two records.

If I do the JQL statement: issueLinkType = "is blocked by", Issue Two is correctly the only issue that is returned.  Here is a screenshot of that query:

IssueTwo.PNG

However, when I execute the JQL Query: issueLinkType = "blocks", (lower-case b, to distinguish it from "Blocks"), instead of only returning issues that block other issues, it returns all issues that are either blocking, or being blocked--in the example, both Issue One and Issue Two are returned.  Here is a screenshot of that query:

IssueOne.PNG

(1) How can I create a JQL query that will only return issues that block another issue, or (2) is this just a bug in how the "blocks" keyword behaves, at the moment?

Here is a quick video demonstration of the issue, in case anything about this question is unclear:  Link to quick YouTube video demonstrating question 

I've tried issueLinkType != "is blocked by", but that doesn't return anything.

Thanks, let me know if anything could use clarified.

2 answers

1 vote
Jeremy Gaudet
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 Champions.
February 11, 2016

Maybe it's not static, so you need to instantiate a ProjectRoleManager.  I use this:

ProjectRoleManager projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class) as ProjectRoleManager

ProjectRole devsRole = projectRoleManager.getProjectRole("Developers")

There's probably a cleaner way to do it, I just pulled that off the net somewhere.

JamieA
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 Champions.
February 12, 2016

Use ComponentAccessor.getComponent(...) but otherwise yes that's the problem. You can tell by:

No signature of method: static com.atlassian.jira.security.roles.ProjectRoleManager.getProjectRole() 

 

0 votes
DonPerera
Contributor
August 15, 2019
ProjectRole projectRoles = ComponentAccessor.getComponentOfType(ProjectRoleManager.class).getProjectRole("");

Suggest an answer

Log in or Sign up to answer