Find all tasks that contain subtasks inside - jira

It doesn't matter what values the fields have. I am interested in the fact of the existence of a subtask inside.

You could try the following JQL:
issueFunction in hasSubtasks()
it filters for such issues which satisfy condition hasSubtasks() which is a function for identifying issues with subtasks (but not other types of links).

It seems there are no special operators in JQL for such cases but I've found the solution:
using obviously non-existent task names in combination with issueFunction in parentsOf()
like this issueFunction in parentsOf("issue != BLABLA-100")
It works! And if you wanna get issues without subtasks you can put NOT before the request described above

Related

JQL for getting all epics related to an epic and all stories created under that epic

What I'm trying to do.
We have board which contains an Epic. Lets say the key of this epic is "MY-01".
Now, I have another epic on a different board with key : "AOB-01".
Under epic "AOB-01" I have created story: AOB-03 and AOB-04.
Now I want a JQL which gives me all issues related to MY-01 AND the children of all issues created under that link.
I have used:
issue in linkedIssues(MY-01, "relates to") to get all epics under MY-01.
Then I have:
issue in childIssuesOf("AOB-01") to get all stories (in this case AOB-03 and AOB-04).
But I cannot get a JQL which combines these two.
Can anyone help me out?
Regards,
Barry
If you want to combine 2 JQL queries you can use the operator "AND":
issue in linkedIssues(MY-01, "relates to") AND issue in childIssuesOf("AOB-01")

Querying JIRA to Produce Counts of Issues by Different Type

Suppose I have the following JIRA filter.
project = XXX AND resolution = Unresolved AND assignee in (EMPTY) ORDER BY Type asc, priority desc
I use it to see all unassigned issues in a certain project and pull from for triage.
Every now-and-then, I need to know how many are in each Type, i.e., I actually want a count for each.
How could I modify this query to do that or write a new one that accomplishes the same thing?
Remember that JQL isn't SQL - it just operates on tickets and returns lists of them for other parts of JIRA to consume, and doesn't really have a mechanism for counting results.
That said, you can use the JIRA REST API's /search endpoint along with maxResults=0 to construct JQL queries for each Type you care about, and the endpoint will give you a total value for that ticket Type:
https://jira.url/rest/api/latest/search?jql=project%20=%20XXX%20AND%20resolution%20=%20Unresolved%20AND%20assignee%20in%20%28EMPTY%29%20AND%20Type%20=%20Task&maxResults=0
Results in this output for Type=Task:
{
"startAt":0,
"maxResults":0,
"total":123,
"issues":[]
}

Visual studio online query items without tags

When are working with various Work Item types (user stories,Tasks, etc) we assign tags to reference the area of work. This makes it easy to filter the Backlogs items view to find any related stories.
I would like to build a query to identify Work Items where the tags have not yet been assigned.
I know this can be achieved using excel and filtering, however I specifically would like to do this using the queries. Is this possible??
Thanks in advance for any assistance.
Firstly, I have to say that it is not possible to create work item query to show work items which don't contain tags. As you see that the Operator for Tags is Contains or Does Not Contain, it is not possible to use these two operators to filter out these non-tagged work items.
Secondly, as you have more than 100 tags, it is not an effective way to use "Does Not Contain" operator to exclude all tagged work items.
So,
How about you adding a 'Null' tag to all non-tagged work items to specify that these work items don't have any tags? With this approach, you can create a work item query with Tags Contains Null to list these non-tagged work items.
If you don't want to take this approach, you need to work with excel just as you mentioned above, or take Dave's advice to work with API.

TFS query for tasks with no parent

I would like create a Flat list of work items query in TFS in which the results contain all of the specified PBI and Bug cases and any Task cases that have no parent.
It's that Task with no parent part that has me perplexed. I cannot see a way that I can do what seems so obvious such as (Parent Link Count = 0) because that attribute is not exposed to me though, strangely, some other link type counts are.
Any ideas?
You need to change the type of your query to the Direct Links query, then choose the option to pull back all work items without any matching links. The results will still be a flat list.

In JIRA, how can I create an issue filter that excludes duplicates?

I have a JIRA issue filter in which I list a set of issues that meet my criteria. Some of these have links of type duplicates. I want to exclude those duplicates issues from my query.
Logically I am looking for something like:
...
AND ! hasLinks('duplicates')
I believe this functionality is in the JQL Tricks Plugin, but this plug-in is pretty pricey.
Is there any way to do this natively with JQL?
Try this:
https://confluence.atlassian.com/display/JIRA050/Advanced+Searching#AdvancedSearching-CONTAINS:~
The "~" operator is used to search for issues where the value of the specified field matches the specified valu
Assuming that the issue has status Closed with resolution Duplicate, try this filter:
... and (resolution is empty or resolution != Duplicate)

Resources