Is it possible to define variable values in JQL

J V May 14, 2014

Hello - I have a requirement to create a customized Filter / Dashboard and I should be able to generate the Defects by Project & by Release & per week / per month. I have multiple projects and Releases almost every week. So, I cannot update the same filters each time with different dates.

is it possible in JIRA to define a particular filter with a Variable value and every time I want to refresh my dashboard, I am prompted with a popup or dropdown asking to enter the Start and End Dates or Month and Year?

2 answers

0 votes
Daniel (home) Harvey February 9, 2017

See answer here about using a filter and a condition on other filters. This enables one filter to contain the date condition which can be used by multiple other filters.

This is not quite what you wanted but does enable simpler setting of a date range (or the like) for a number of filters which could be used on your dashboard.

0 votes
BenjiI
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.
May 14, 2014

Hey J V,

This feature is currently not available by default. You can introduce some parameters in your JQL, f.e. search with current assignee, but this method is not very flexible. You can always do some custom development with the rest API to make your JQL parameters parameterizable:

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues

BenjiI
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.
May 14, 2014

Another option is to tweak the URL used by JIRA:

https://trackit.aca-it.be/jira/issues/?jql=project%20%3D%20test%20AND%20assignee%20%3D%20jira

The part after jql= is the actual query. To construct this url you can for instance do the following in javascript:

<script type="text/javascript">
	baseURL = document.location.origin + document.location.pathname + '?jql=';
	query = 'project = test AND assignee = jira';

	fullURL = baseURL + encodeURI(query); // This is the url you can use to redirect
</script>

The parameters for the query (project and assignee) can be asked from the user via an input box.

Hope this helps?!

J V May 14, 2014

Hello Benji,

Appreciate your quick response. Unfortunately, I am in Testing team and do not have the privileges to make any changes to the API's. Even if I want to suggest this solution to my Config team, I might endup with an answer that this will impact all the projects across the organization and they wouldn't want to make such changes.

However, it would be great if Atlassian can make such ENhancements in Future.

-JV

Suggest an answer

Log in or Sign up to answer