Surfacing all Stories belonging to Sprints that contain specific text

Dominic Fosson April 12, 2024

Background

We release major releases quarterly. Each of our Product teams works in 2-week sprints within each major release period and we're struggle to bring together all of the issues being worked on over the course of each sprint within each major release - in large part because each team names their sprints uniquely; however, each one contains the name/id of the sprint (e.g. 2024.3.1.0)

The Ask

As a potential solution, I'm trying out ScriptRunner in the hopes that it can provide the searching capabilities needed. As an example, I'm trying to surface all of the Stories that belong to a Sprint whose name contains "2024.1.1.0". This would work great as it would require no additional record-keeping from our teams and would provide a way for me to consistently stay ahead of these reports as I already know what the sprint ids will be.

I've played around with the JQL AI in ScriptRunner and haven't been able to make it work. Is something like this possible?

 

4 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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 12, 2024

Hello @Dominic Fosson 

Two options:

Without Scriptrunner: (reference)

project in (KPMS, FNQD) and sprint = "22024.3.1.0"

 

With Scriptrunner: (reference)

issueFunction in issueFieldMatch("Project in (KPMS,FNQD)", "Sprint", "2024.3.1.0")

 

When projects KPMS/FNQD need to be replaced with your specific ones.

Please try and let us know.

Dominic Fosson April 12, 2024

Thanks, Kalyan! I really appreciate you responding. I tried the following and it timed out due to "too many issues" (though I know there's only a handful):

issueFunction in issueFieldMatch("Project in (PD)", "Sprint", "2024.3.1.0")

I'm still learning here, but a couple follow-up questions I have are:

1. Given that I'm looking for the results to surface stories, shouldn't there be some callout in the JQL that references "stories" specifically?

2. I'm trying to work-around that the fact that sprints across our different product teams take on different naming structures (e.g. "Profile Re-design 2024.3.1.0" or "Admin Experience Catalog Work 2024.3.1.0"). They'll often start/end with different text, but they'll each contain the Sprint name ("2024.3.1.0") somewhere within them. Does the query you gave account for this "wildcard" element?

Kalyan Sattaluri
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 12, 2024

hello,

If you want only stories, append additional clause:

issuetype = Story and issueFunction in issueFieldMatch("Project in (PD)", "Sprint", "2024.3.1.0")

 

If above is timing out, try below as well,

issuetype = Story and project in (PD) and sprint = "22024.3.1.0"

 

Both above queries are looking at partial string in sprint name so should be good with your criteria.

Dominic Fosson April 12, 2024

Thank you, Kalyan. 

The first query was valid, but timed out (again, it should only return a small handful of issues).

The second was invalid because "The operator '=' is not supported by the 'sprint' field."

If the query itself seems like it should work, maybe I just need to veer my research into overcoming these timeout issues.

 

 

Kalyan Sattaluri
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 12, 2024

Hello,

Below is a valid query:

issuetype = Story AND project in (PD) and sprint = "22024.3.1.0"

Please retry or share what you are searching by..

Dominic Fosson April 12, 2024

Ah! I pasted in what you provided, but this time replaced "sprint" with the ID of the field and that did the trick! Thank you very much for your help, Kalyan!

If you'd be willing, there was one additional piece I was looking to add to build upon this.

What you provided worked brilliantly to surface all the Stories across teams that belong to a certain sprint. I'm trying to get the same view at the Initiative level. Given that Initiatives aren't themselves aligned to a specific sprint, I'm now looking to surface all the Initiatives that are parents of the Epics that are parents of the Stories belonging to a given release

This was the query you helped me with that I ultimately ran successfully:

issuetype = Story AND project in (PD) and cf[10007] in ("2024.1.1.0", "2024.0.0.0", "2024.0.1.0", "2024.0.2.0", "2024.0.3.0")

 

Dominic Fosson April 12, 2024

Ah! I pasted in what you provided, but this time replaced "sprint" with the ID of the field and that did the trick! Thank you very much for your help, Kalyan!

If you'd be willing, there was one additional piece I was looking to add to build upon this.

What you provided worked brilliantly to surface all the Stories across teams that belong to a certain sprint. I'm trying to get the same view at the Initiative level. Given that Initiatives aren't themselves aligned to a specific sprint, I'm now looking to surface all the Initiatives that are parents of the Epics that are parents of the Stories belonging to a given release

This was the query you helped me with that ultimately ran successfully:

issuetype = Story AND project in (PD) and cf[10007] in ("2024.1.1.0", "2024.0.0.0", "2024.0.1.0", "2024.0.2.0", "2024.0.3.0")

 

Dominic Fosson April 12, 2024

That worked! I wanted to build on this with one last thing:

We accomplished this brilliantly at the story level - can we do the same at the Initiative level?

Can we surface all the Initiatives that are parents of the Epics that are parents of the Stories that belong to a certain sprint?

 

Kalyan Sattaluri
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 12, 2024

Thats great to hear.

To get all initiatives, you will the scriptrunner add-on.

So you query will look like:

issueFunction in parentsOf('issuetype = Story AND project in (PD) and sprint = "22024.3.1.0"', "all") AND issuetype = Initiative

Please see here for documentation on this function: LINK

I am not in cloud so I havent tested this syntax.

Data center has different function. Please try and let me know if issues..

Dominic Fosson April 15, 2024

Works like a charm! Thank you so much for all your help, Kalyan!

Like Kalyan Sattaluri likes this
0 votes
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 13, 2024

Hi @Dominic Fosson

if you're open to other solutions from the Atlassian Marketplace, this should be easy to do using the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. Using JXL's text filter option, you can build a view like e.g. this in just a couple of clicks: sprint-text-search.gif

For more sophisticated filter operations, you can also use regular expressions. I should also add that JXL can do much more than the above: From support for configurable issue hierarchies, to issue grouping by any issue field(s), sum-ups, or conditional formatting.

Any questions just let me know,

Best,

Hannes

Dominic Fosson April 15, 2024

This looks incredible - appreciate you reaching out. I'm going to check it out now.

0 votes
Dominic Fosson April 12, 2024

.

0 votes
Dominic Fosson April 12, 2024

Ah! I copied what you provided, but this time replaced "sprint" with the field's ID and that did the trick!  Thank you very much for your help, Kalyan!

There was one additional piece I was looking to build upon by this that I haven't nailed down either - if you'd be willing to provide a bit more assistance.

This query has provided all the stories brilliantly. Now, I'm looking for a way to do the same, except to surface only the Initiatives of those Stories. Given that Initiatives aren't aren't themselves aligned with a Sprint, what would the query look like to surface just the initiatives that are the parents of Epics that are the parents of Stories that belong to a certain sprint? 

This is the query that surfaced the Stories satisfactorily:

 issuetype = Story AND project in (PD) and cf[10007] in ("2024.1.1.0", "2024.0.0.0", "2024.0.1.0", "2024.0.2.0", "2024.0.3.0")

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events