Jira stories that are blocked by other project - jira

I am trying to write a Jira JQL filter that returns all issues in my project (named ABC) that are blocked by an issue in another project (named XYZ), or in any other project except my own ABC project.
First part of the filter that returns all stories in my project that are blocked, this is easy:
project=ABC AND issueLinkType = "is blocked by"
But from that list, I only want to see stories that are blocked from another project.
This works:
project=ABC AND issueLinkType = "is blocked by" AND issueLink in (XYZ-5021)
but then I need to know the IDs, so what I am looking for is more like the below examples that do not work:
project=ABC AND issueLinkType = "is blocked by" AND issueLink in (XYZ-*)
project=ABC AND issueLinkType = "is blocked by" AND issueLink in (project!=ABC)
project=ABC AND issueLinkType = "is blocked by" AND issueLink in (filter=12345)
Can this be done with normal Jira JQL? Is it possible at all, maybe with some extension?

You cannot perform that operation directly with naive Jira.
However, one of the most popular extension, ScriptRunner, has different JQL functions to help you.
You can check all the JQL Functions in ScriptRunner from this link.
linkedIssuesOf will help you about the JQL that you are trying to achieve:
project = ABC and issueFunction in linkedIssuesOf("<some-filter>", "is blocked by")

Related

Change a card color in JIRA Cloud for blockers

Again, I do not have enough of a reputation to respond to the post string already out there, so I am creating a new post. Apologies for the duplication.
I'm trying to do the same thing as this post: JIRA JQL: coloring cards by blocked status
However I have JIRA cloud, which means I am limited on what ScriptRunner does as well. Can anyone help?
I have been trying to do this as well for a few weeks. So far I have not found a way to accomplish this using JQL. The capabilities of JQL just seem too limited. Honestly this is very disappointing to me as there is hardly any point in blocker links if you cant use them in any meaningful way for quick visual indicators.
Ideally a blocked issue should get some sort of lock icon added and blockers should get a key or something.
Summary: JQL does not seem capable of accomplishing this.
This is partially possible to implement for JIRA Cloud using (paid) Jql Search Extensions for JIRA plugin:
Red (blocked): linkType = "is blocked by" AND linkedIssueStatusCategory in ("To Do","In Progress")
Blue (blocker): linkType = blocks AND linkedIssueStatusCategory in ("To Do","In Progress")
Green (unblocked): linkType = "is blocked by" AND linkedIssueStatusCategory not in ("To Do","In Progress")
But this plugin's limitation is we can't check linkedIssueStatusCategory only for issues of some linkType - instead check applies to all linked issues. This means some cards which have links of more than one type will have wrong colour. For example:
if issue has 1 "is blocked by" link to "Done" issue and 1 "blocks" link to "To Do" issue - it'll have Red colour instead of Blue
if issue has 1 "is blocked by" link to "Done" issue and 1 "relates" link to "To Do" issue - it'll have Red colour instead of no colour
If it's better to see possibly-not-blocked issues as not Red, then we can use this instead:
Red (guaranteed to be blocked): linkType = "is blocked by" AND linkedIssueStatusCategory != Done

How to find all Subtasks where parent is assigned to me

We're using Jira stories to cover specific areas of functionality that a team member owns.
We're using sub-tasks to create a dependency chain to show when all bugs and enhancements have been finished for a story.
I would love to be able to create a query that shows subtasks where parent assignee is current user. Is this possible?
Volodymyr's answer is close, but the correct query is actually this:
issueFunction in subTasksOf("assignee = currentUser()"))
Not with a standard JIRA JQL, but for JIRA server there are couple plugins that add handy JQL functions.
With ScriptRunner https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner:
type = sub-task and issueFunction in parentsOf("assignee = currentUser()"))

Is there a JIra query which will return all stories without an EPIC?

I'm trying to tidy up our Jira board and create an accurate story map.
To do that I need to come up with a query that will return open user stories within a certain project that don't have any issue links (preferably 'related to (primary)')- the last part does not seem to be supported.
I've had a look around an post of the Q&As are a few years old, so i'm wondering if it was been updated recently?
I'm using version 5.1
Thanks!
issuetype = Story and "Epic Link" != EMPTY
I used the following query:
project = PROJECTNAME AND issuetype = Story AND "Epic Link" is EMPTY
Seems to work for me, what do you guys think?
In addition to "Epic Link" = EMPTY, you might want to filter out issues that, themselves, are EPICs, since they can't have Epic Links and will otherwise show up in the search.
Here's a search to get only issues that have no Epic (but are not Epics themselves):
issuetype != Epic AND "Epic Link" is EMPTY
Just to throw another answer into the bowl.
You can use your normal workboard (Scrum, Kanban, etc) and add a swimlane with the JQL:
"Epic Link" is EMPTY
Just did this for our board after looking exactly for this.
I don't have enough points for comments or votes yet ... but to add to the one answer provided about the "Board", the JQL will work in a simple issue search as well. I just ran this JQL from Issue Search and it worked like a champ:
project = BI and "Epic Link" is empty
project = PROJECT NAME AND issuetype = ISSUETYPE AND "Epic Link" = EMPTY

Jira Quick-filter to show all task with subtasks assigned to current user

Currently, I have a quick filter to show me my task that does this:
assignee = currentUser()
This works ok, but doesn't show me tasks that are assigned to someone else, but have subtasks assigned to me. Is it possible to make it show me both tasks assigned to me, and tasks that have subtasks assigned to me?
Create a filter for all of your subtask from the following JQL:
issuetype in subtaskIssueTypes() and assignee = currentUser()
Then, using Craftforge JQL Functions Plugin, use the following JQL to find their parents:
issue in parentIssuesFromFilter("filter name or its id")
The following query will return all parent tasks, which have sub-tasks assigned to the current user. (The parent task need not be assigned to current user)
issueFunction in parentsOf("assignee = currentUser() ")
Note: issueFunction requires the ScriptRunner plugin and it's not free.
In addition to #Kuf's answer, it's sometimes much simpler to write the whole thing in one query especially with Swimlanes or Quick-Filters in Greenhopper, rather than creating and saving custom filter.
For instance, to show Un-finished Issues or Sub-tasks in one quick-filter on Greenhopper:
status!=Closed or issue in parentIssuesFromQuery("issuetype in subtaskIssueTypes() AND status!=Closed ")
Navigate to Issues (in header) > Search for issues, then enter your search criteria.

List all JIRA tasks that are not blocked by other tasks

Using JIRA 4.4.3,
I've created a filter that list all the tasks that:
- The current user is assigned to;
- are Open;
- are not blocked by any other task.
To make it clear: the task that are ready for a user to work on.
We've installed the Craftforge JQL Functions plugin, and I've come with the following JQL query:
assignee = currentUser()
AND status in (Open)
AND issue NOT IN linkedIssuesFromFilter("All Issues", "Blocks", "Outward")
The problem is that when an issue that was blocking another issue is resolved, the "Blocks" link still exist -- and I don't want to delete it. But my query doesn't check if the linked issue is closed/resolved or not.
How can I add a condition "inside the IN statement" that will only return queries that are blocking the current task AND that are still OPEN.
Use this clause from http://www.j-tricks.com/jqlt-links-functions.html:
issue not in linkedIssuesInQuery("status = Open", "is blocked by")
If you have the ScriptRunner add-on, you can use it to do this:
resolution = unresolved AND assignee = currentUser() AND (issueFunction in linkedIssuesOf("resolution is not empty", blocks) OR issueFunction not in hasLinks("is blocked by"))
I've created a new filter named "All active issues" that list all issues that are open, in progress or re-openned.
And I've used that new filter in my query instead of "All Issues".
Seems solved :)

Resources