Parameters in Queries

George Forsyth September 3, 2012

I am new(ish) to JIRA and I am writing queries but do not know how to input parameters. E.g. List stories created between 99/99/99 and 99/99/99 where the dates are entered at run time.

Is there way to do this?

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2012

There's two types of search in Jira, simple and advanced. If you go to search, you will usually be offered simple at first, look at the top left to switch to advanced.

Advanced searches are done by entering JQL (it's like SQL, but is only the "where" part of a query, and it's Jira aware rather than table aware). For example, "Project = OPS and Created > 30/10/2011 and Created < 31/12/2011" to list all issues created between 30th October 2011 and the end of the year, in project OPS

A simple query presents you with a list of parameters that you can fill in. To do the query above, you'd select OPS from the project list, then enter the two dates in the "created before" and "created after" fields.

For a lot more detail, see https://confluence.atlassian.com/display/JIRA/Searching+for+Issues

George Forsyth September 3, 2012

Many thanks, Nic. However, what I wanted to do was to write and save a query that could be re-used. When run it would present me with the variable parameter fields so I could enter different values each time rather than writing a new query each time. Is this possible?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2012

Queries that can be reused - yes - you can save a filter and share it, and then use it repeatedly in all sorts of places (gadgets and reports). They are of course, dynamic - if the results of a filter change then they return the currently matching items as they are "run". (Simple example - "issues created in the last 5 days")

Prompting people for specific fields, no.

It's not a particularly good model IMHO, as it discourages people from actually thinking about what they're doing. I've lost count of the number of times I've worked at places where you can do this and seen swathes of utterly useless reports. Share a filter with your users, and then tell them to change it (Jira will create a copy for them, not break your existing on) and then educate them to use the simple search - you'll soon find they are happily generating their own reports and letting you get on with real work.

George Forsyth September 3, 2012

Nic, thanks again. As I thought but it's saved me some time in trynig to find a way.

Suggest an answer

Log in or Sign up to answer