The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

Yes, its admin user. 

0 votes
Florian Bonniec
Community Champion
December 4, 2024

Hi @kapild 

 

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

 

Regards

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events