JQL project filter not working with curl

kapild December 4, 2024

I am trying to fetch issues of a specific project using curl and JQL. 

I have tried the same JQL in JIRA filter and also in the browser 

XXX.atlassian.net/rest/api/2/search?jql=project%20=%20%27IT%20Access%20Management%27%20AND%20status%20=%20%27In%20Progress%27

But when I try this with curl it shows error:

{"errorMessages":["The value 'IT Access Management' does not exist for the field 'project'."],"warningMessages":[]}%

Here is the sample curl request 

> encoded_jql=$(printf '%s' 'status = "In Progress" AND project = "IT Access Management"' | jq -s -R -r @URI)
>

curl -u "PUBLIC_KEY:PRIVATE_KEY" -X GET "https://XXXXX.atlassian.net/rest/api/3/search?jql=$encoded_jql"

Just to clarify, when I remove project filter it works fine. And with project filter it works well with JIRA filter and browser URL query. 

3 answers

0 votes
Marc - Devoteam
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.
December 4, 2024

Hi @kapild 

The call seems ok to the API via the browser.

In your curl the quotes seem to be wrong.

String needs to be quested with "string" and not 'string'

kapild December 4, 2024

I tried both ' and ". And it doesn't work. 

Marc - Devoteam
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.
December 5, 2024
0 votes
kapild December 4, 2024

Yes, its admin user. 

0 votes
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Hi @kapild 

 

Are you sure the user you are using have permission on the  "IT Access Management" project ?

 

Regards

Suggest an answer

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

Atlassian Community Events