Using "Get project versions paginated" when version name contains special chars

Rees_ Ian
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.
November 4, 2024

I am using the Get PRoject Version paginated api call to get the fix version id for a version I know the name of fix version.

I am using the name of the fix version using the query parameter which should find the version with matching name or description.  This all works find when the fix version name is simple but on some more complicated fix version names, the web request just goes "Waiting" and eventually is "aborted" with the message ...:Illegal character in query at index 77:...".

Question 1: How do I make the query resilient to people using 'special' characters in their fix version name and causing the above error

Question 2: The potential flaw in the above is that it also matches Description whereas I want to specifically look at a version name - if I make the call without the query parameter and get a 'paginated' list of all fix versions - how do i parse a list in the webresponse body to find the entry that matches my fix version name ? Thanks 

1 answer

1 accepted

0 votes
Answer accepted
Rees_ Ian
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.
November 4, 2024

It appears that using urlencode on the query parameter enables me to get the id

.../rest/api/3/project/{{issue.project.key}}/version?query={{varFixVersionName.urlEncode}}

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