Categories
JQL Help with ScriptRunner

find issues with sub-tasks

A colleague asked me if he could use sub-tasks under Features or only under Epics. Sometimes people get confused about the naming of our custom issuetypes.

We use Epics (which are basically issuetypes with a superiority complex) to house our Feature and Story issuetypes. Sub-tasks cannot be added to Epics – it’s just the way it is. But I did add Sub-Tasks to Features to break down what needs to be done in the planning stage.

So… I wanted to give him an example of a Feature issuetype that had sub-tasks. The Atlanta Community and ScriptRunner came through again and I found this:

project = “My Project” AND issueFunction in hasSubtasks()

You can only use issueFunction if you’ve purchased Adaptavist’s ScriptRunner add-on. (available for Cloud, Server, Data Center)

Atlanta Community Resource: https://community.atlassian.com/t5/Jira-Core-questions/JQL-filter-for-Stories-without-Subtasks-without-plugin/qaq-p/134415

Categories
JQL Help

jql to find components by dev lead’s username

I wanted a way to find all components lead by a Lead Developer and list them on a Board’s Quick Filter. We have some leads that manage multiple components and needed a way to display all Lead Devs’ Components.

I could have created the jql to say:

component in (component2,component3)

but components could get added. The more constant variable was the developer username (greater chance of a component change than an employee change). This is what I used instead and I hear it’s an out of the box function; not from ScriptRunner.

component in componentsLeadByUser(kmcinerny)

I found help in the Atlassian Community: https://community.atlassian.com/t5/Jira-Questions/Create-a-JQL-Query-for-Component-owner/qaq-p/101589

Categories
JQL Help

how to search for specific sprint data

Jira Query Language JQL used for filtering/searching Jira issues, is a little tricky sometimes especially when working with custom fields, cascading select field types and sprints.

With this JQL you can find past sprints that had items with a specfic status:

Sprint in (411, 413, 415) AND status = “In Production”

You find Sprints by searching using the Advanced filter and just start typing the sprint name; notice the key in parens.

When you select the sprint name, the key will be inserted for you (the warning symbol just means that I didn’t close the parens).

That’s it – short and done.

Categories
JQL Help with ScriptRunner

find issues with no links

I was asked to find all issues in the previous 3 Sprints that are not linked to anything. Fortunately we have Adaptavist ScriptRunner, so I just ran this:

Sprint in (411, 413, 415) AND issueFunction not in hasLinks()

Unfortunately, you only get Jira keys in the result, and you would have to open each one to see details (ie: issuetype, Summary). One of our protocols is to ensure that every Story worked on in Engineering is linked to a Feature issuetype. We categorize our versions by Features.

I had to go back and update this post:

  • removed project filter because these Sprints were already in the Engineering Project and it was superfluous.
  • removed status because that wasn’t the ‘ask’. Not all issues get completed in a sprint, so you might want to add that.
  • removed a check by resolved date and didn’t need that either.