Is it possible to use global variables with JQL query

Peter Hiross October 22, 2024

Hello,

We are using Confluence page for our release notes. The confluence page consists of a set of services where each service has a JIRA-issue filters that executes a query to capture changes made to the service over the course of several sprints.

Our query looks like this:

project = "myProject" AND fixVersion ~ "19.0.0*" AND component=myservice ORDER BY fixVersion

While this work great we have a large number of services and it requires us to edit each of these JIRA-issue filters and update the version i.e., fixVersion ~ "19.0.0* -> FixVersion ~ "20.0.0*"  for our next release.

Is there away one can set a global variable once for fixVersion   and reference this variable in our JIRA-issue Filter? 

project = "myProject" AND fixVersion ~ $FIX-VERSION AND component=myservice ORDER BY fixVersion

 

We do have scriptrunner as an option.

Thank you in advance

3 answers

1 accepted

3 votes
Answer accepted
Bill Sheboy
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.
October 22, 2024

Hi @Peter Hiross 

I do not believe using variables that way is possible with JQL, and...

 

Have you considered using chained filters on the page?  For example:

create one saved filter with your Fix Version test:

project = myProject
AND fixVersion ~ "19.0.0*

Get the identifier for the filter; let's assume it is 12345.  And so a search of it would be:

filter=12345

Add that to any other searches filters needed:

filter=12345
AND component = myservice
ORDER BY fixVersion ASC

When your "variable" needs to change, only that first saved filter will need to change.

 

Kind regards,
Bill

Peter Hiross October 22, 2024

Bill this is sweet. At least this is better than having to change the filter in EVERY JIRA-Issue Filter. I'll give it a try.

Like Bill Sheboy likes this
0 votes
Sujeet Pathak
Contributor
October 22, 2024

Hi @Peter Hiross  , this is Sujeet from Amoeboids. We have an app in the Atlassian marketplace that can serve your use case - [AI powered] Automated release notes & reports for Jira.

Here, you can generate release notes in Confluence, where you can create reusable release notes and report templates using variables within the JQL and even in the template body. Through rule automation, you can create new pages, update existing pages, and append/prepend contents to existing confluence pages. The app also allows you to use other formats such as Email, PDF, Slack, PowerPoint, etc., and automate the delivery of your release notes and reports to relevant stakeholders through rule Automation. 

If you are on the cloud, we even have a free version of this app to get you started quickly.

Do check out and reach out here if you need any further information.


Thanks,
Sujeet 

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2024

Hi Peter,

Unfortunately no, you can’t use variables in JQL.

 

Suggest an answer

Log in or Sign up to answer