Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Querying for exact string in Jira Cloud API

Inna S
Contributor
August 4, 2024

Hi, 

Searching for specific Release / Version via API using 

 

/rest/api/3/project/{projectIdOrKey}/version?query=string

and the results are not strict:

if I have a version 'aa' and another one 'aaa', the search for 'aa' brings both.

What is the proper way to request a strict string match with the Jira Cloud API?

Thank you

2 answers

1 vote
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.
August 4, 2024

Hi @Inna S 

How are you calling the Get Project Versions Paginated one: automation rule, external app, something else?

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-project-projectidorkey-version-get

Regardless of the approach, the documentation only describes the query parameter used to search the name or description, with little other filtering.  When you need more granularity, perhaps initially filter on what you describe using the call and then use a regular expression on the results.  For example, with an automation rule that could be with the match() function.

Kind regards,
Bill

Inna S
Contributor
August 6, 2024

Hi @Bill Sheboy ,

thank you for the suggestion.

I am running from within the automation rule, looking for specific version

rest/api/3/project/<projkey>/version?query={{Version}}

The ultimate goal is to get the scope creep info: items added to a version past its start date. But because Jira has nothing of the sort, I'm going step by step to retrieve the version details, issue history, compare the dates, etc. And now there are extra steps (looping over the list, regex) to get to the version.

It sounds like a lot of work for the basic functionality that should have been in the product long ago.

 

 

Like Bill Sheboy likes this
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.
August 8, 2024

Like any programming language, Atlassian Automation has its strengths and weaknesses.  As it continues to evolve with new features, keep watching for community posts and the weekly release blog of improvements that may help make your scenario easier.

0 votes
Bastian Ran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2024

Same question here, it would be great if Jira could support rest/api/3/project/<projkey>/version?query={{Version}}&matchType=EXACT

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events