Is it possible to define variable values in JQL

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

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

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?!

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

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

45 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you