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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,641
Community Members
 
Community Events
176
Community Groups

A REST API question - a JQL works in JIRA but not when I use it in a curl call

This worked in an advanced search in JIRA :

project = OTCI AND 'Development Site' = 'Remote - WFO Unix'

but the curl command doesn't return anything:

curl -G "https://ontrack.venturesolutions.com/jira/rest/api/2/search?jql=project%20%3D%20OTCI%20AND%20Development%20Site%20%3D%20Remote%20-%20WFO%20Unix&startAt=&maxResults=1000" -H 'Content-Type: application/json' -H 'Postman-Token: 753b8f93-53d2-4b1a-9b72-d4abd' -H 'cache-control: no-cache' -u 'Unix2Jira:Jira@XXX' -k --cacert dummy_path_none_required/ontrack_venturesolutions_com.crt -d

while this curl command works fine:

curl -G "https://ontrack.venturesolutions.com/jira/rest/api/2/search?jql=project%20%3D%20OTCI%20AND%20STATUS%20!=%20CLOSED%20AND%20STATUS%20!=%20Wrap-up%20AND%20STATUS%20!=%20COMPLETE&startAt=2000&maxResults=1000" -H 'Content-Type: application/json' -H 'Postman-Token: 753b8f93-53d2-4b1a-9b72-d4abd' -H 'cache-control: no-cache' -u 'Unix2Jira:Jira@XXX' -k --cacert dummy_path_none_required/ontrack_venturesolutions_com.crt -d

Does the curl command not have access to the column "Development Site" ?

 

 

 

 

1 answer

Going to take a guess at this. But first:

Curl = browser. It has no extra or less access. 

WFO=UNIX or Development Site = Remote is throwing a problem. I can't spot anything else on my phone. 

Ah start at= is nothing in the first command. Could you populate this and rerun?  Also just run that JQL normally and confirm it returns values. 

your right, I didn't have the startAt set.  But I corrected that and still no records selected:

curl -G "https://ontrack.venturesolutions.com/jira/rest/api/2/search?jql=project%20%3D%20OTCI%20AND%20Development%20Site%20%3D%20Remote%20-%20WFO%20Unix&startAt=0&maxResults=1000" -H 'Content-Type: application/json' -H 'Postman-Token: 753b8f93-53d2-4b1a-9b72-d4abd8352221' -H 'cache-control: no-cache' -u 'Unix2Jira:Jira@123' -k --cacert dummy_path_none_required/ontrack_venturesolutions_com.crt -d

I noticed that when I call our function that builds the curl command , I am entering :

JiraGet key,fields:{customfield_17711:value} project = OTCI AND 'Development Site' = 'Remote - WFO Unix'

but it looks like when it builds the curl command it is removing the single quotes and that may be messing up the curl command.  I'll do some more checking if I can follow the code in our function to see how  that is happening and let you know.

Thank you for your time on  this..

yes,  thats what the problem was.  I was supposed to comment out the quotes.  Its working fine now.  Thanks again

Like colin mcdermott likes this

You are welcome Bill. Glad I could help

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events