Forums

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

How to query a custom field in jira with sprint values

Selva Praveen Elango October 3, 2024

I have a custom field created in jira, 

I have populated the current sprint name to this field

now i have to write a filer to query this custom field and get all issues that have the current sprint name in it . 

is this possible to do ?

 

1 answer

1 vote
Walter Buggenhout
Community Champion
October 3, 2024

Hi @Selva Praveen Elango,

I don't quite understand why you are making such a complex workaround. Can you explain what you are trying to achieve and why you don't simply run:

Sprint in openSprints()

That dynamically returns all issues in the current sprint, from the actual sprint itself.

You should be able to search on any field in Jira, but from your description I tend to assume your created a text custom field, which makes it difficult to search on exact names (it works with a ~ (like) operator instead of =(equals)), so if you don't need the workaround I would not do it that way ...

Hope this helps!

Selva Praveen Elango October 3, 2024

@Walter Buggenhout 

I have create a custom field ( a short text field ) , have populate sprint name to the field .

I now have to check whether the value in the custom field matches the sprint value in the issue 

 I am trying to build a dashboard with Rich filters app

for example

the custom field i have populated 'Sprint 9'  so when i choose sprint 9 in the dashboard i want to show the custom field which matches the selection 

 

Walter Buggenhout
Community Champion
October 3, 2024

Is there any reason why you can't add the sprint field as a dynamic filter to your Rich Filters filter controller and filter by the actual sprint itself? That should return all issues in that sprint.

I can't wrap my head around why you would duplicate that information into a custom field?

Selva Praveen Elango October 3, 2024

@Walter Buggenhout 

the idea here is to display all stories that was marked as spillover in a particular sprint

i have 2 fields a spillover candidate(yes or no field) , spillover sprint (short text field) 

When spillover candidate. is maked yes , the current sprint will be updated to the spillover sprint. 

in the dashboard i am trying to display the stories marked as spillover in a particular sprint. 

so if i mark any story as spillover candidate in sprint 9 , then the spillover sprint will be updated as sprint 9 . 

In the dashboard i can choose sprint 9 and see all the stories that were marked as spillover in sprint 9 

when using the actual sprint field the problem is that it gets updated with sprint names which all the story has been a part of. eg the story marked as spillover in sprint 9 and moved to sprint 10 will have the sprint value as both sprint 9 , sprint 10 

so the story shows as spillover in sprint 10 too but ii need it to be displayed only in sprint 9 selection 

Walter Buggenhout
Community Champion
October 3, 2024

Ok; if you want to make this work on the dashboard, I would recommend you to enable JQL filtering in your filter controller gadget, where you can enter something like this:

"spillover sprint" ~ "\"sprint 9\""

That way, you can search for an exact phrase in a text field.

Apart from that, I would really suggest a good look at what you are trying to get in terms of added value from this.

Your approach requires a lot of steps and actions (setting a check box, copying over a field for a lot of issues at sprint closure, probably doing the same again at the next sprint, creating complex filter scenarios in a dashboard, ...) while most information you might need is - in some form - available out of the box:

  • the sprint report tells you which issues were completed or not in a sprint;
  • at sprint closure, you can decide immediately which issues need to go to the next sprint or back to the backlog;
  • the sprint field lets you query directly for issues in the current sprint (even dynamically) and I am not sure if seeing other sprints the issue has been in is a bad thing;
  • ...
Selva Praveen Elango October 3, 2024

@Walter Buggenhout I under stand the complexity here 

i want to compare 

"Spillover Sprint"  ~ sprint ( which is the original sprint value in jira ) , if this could be done then I Will be able to display the spillovers in the dashboard 

 

is there a way to compare the custom field value to the jira field value ?

Walter Buggenhout
Community Champion
October 3, 2024

Hi @Selva Praveen Elango,

JQL does not let you compare values of fields to other fields. What you could do in your dashboard is use the text filter I just shared in my previous reply and - on top of that also add the sprint field as a dynamic filter option to your filter controller gadget.

If you then apply both, you will only see the issues where Jira's official sprint field does contain "Sprint 9" AND the value of your spillover sprint is the same. 

Like Selva Praveen Elango likes this

Suggest an answer

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

Atlassian Community Events