Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Writing a JQL Query with special characters

I am trying to write a query to look at all fixVersions with 2021.mm*, as I have anywhere between 1 and 3 fixVersions listed per month or varying descriptions, yet each starts with the year and month (YYYY.MM).  How can I write a query to pick up all text in that field that matches my criteria. 

 

I've tried:

  • 2021.03*
  • \\[2021.03\\]
  • "\\[2021.03\\]"

But every time I execute the search I get back an error "The value '\[2021.03.0\]' does not exist for the field 'fixVersion'." or something along those lines.

 

Any help to diagnose and come up with a solution would be appreciated.  Thanks for your help.

 

2 answers

Hi @David Young 

Please take a look at this post describing what Atlassian implemented to support wildcard searches of version fields for Server version:

https://jira.atlassian.com/browse/JRASERVER-24152

Best regards,

Bill

I have tried the search function as I have ScriptRunner on my JIRA Server instance.  However when I run the following query:

filter = 17213 AND Status changed to (Done, Released, Closed) AND fixVersion in versionMatch("2021.03*") ORDER BY fixVersion ASC

 I get 258 results when I should get only about 65 or so.  I looked at why I'm getting so many and I'm pulling in fixVersions 2021.01.01, 2021.1, 2021.01.2, 2021.02.1, and 2021.02.2, however, my query should only be pulling fixVersions that match 2021.03*.

 

Thoughts?  Suggestions?  Am I missing something?

 

According to the link provided, I should be using the following query:

filter = 17213 AND Status changed to (Done, Released, Closed) AND fixVersion in versionMatches("2021.03*") ORDER BY fixVersion ASC

However when I do, I get the following error message:

Unable to find JQL function 'versionMatches(2021.03*)'.

Not sure why JIRA Server Ticket  calls for that text when its written differently.  I still need help getting this query to run correctly.  Any help would be appreciated.

Hi @David Young 

The ticket and notes I linked were for built-in JQL searches with Server version, not with ScriptRunner.  You may want to check ScriptRunner documentation for answers about the search issues you are noting:

https://docs.adaptavist.com/sr4js/latest

@Bill Sheboy,

 

Something I found that was interesting.  I updated my query this morning to test out what was happening, and came across a result that I wanted but I can't explain it.  In my previous iteration my query brought back results from all fixVersions from previous versions this year, e.g

filter = 17213 AND Status changed to (Done, Released, Closed) AND fixVersion in versionMatch("2021.03*") ORDER BY fixVersion ASC

brought results from versions dating back to 2021.01.1.  However, I changed the query to the following:

filter = 17213 AND Status changed to (Done, Released, Closed) AND fixVersion in versionMatch("2021.03.0*") ORDER BY fixVersion ASC

and it brought results only from 2021.03.  It seems that adding a character after the last digit changes the query completely.  I don't need to add the "0" at the end, just the period (.) also returns the same result (which is the results I would expect.

 

I'm curious to know why the results vary, but it seems to work correctly or at least bring back the results I am expecting to find.  Thoughts?  Ideas?

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you