Forums

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

Restrict custom field extraction when using curl

Gerardo Dalena
Contributor
February 13, 2023

Hello,

total noob here :).

I'm trying to use API to get result from a filter, but from all issues I want to only export certain custom fields. If I use this link in the same browser I use for jira:

https://mydomain.atlassian.net/rest/api/2/search?filter=10861&fields=id,key,status,description,customfield_10571,customfield_10063

I get what I want. However, when I use a linux machine to perform a curl with this command:

curl -u my@username:token -o /home/whatever/test.json --request GET https://mydomain.atlassian.net/rest/api/2/search?jql=filter=10861&fields=id,key,status,description,customfield_10571,customfield_10063

The file I get has all the custom field exported. The link that curl and I are pointing is the same, but the result is different. What am I missing?

Thank you!

1 answer

1 accepted

0 votes
Answer accepted
Gerardo Dalena
Contributor
March 9, 2023

Hello,

turns out that the problem was some missing apex. Some characters, such as "&", are not read correctly. What happened was that the curl cut everything that came after the & and it went with the default setting, which is to export everything from an issue. This can be fixed by putting the url between apex:

 

curl -u my@username:token -o /home/whatever/test.json --request GET 'https://mydomain.atlassian.net/rest/api/2/search?jql=filter=10861&fields=id,key,status,description,customfield_10571,customfield_10063'

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events