Hi Team,
Previously we used api/2/search to fetch data but it was deprecated. I tried accessing api/2/search/jql api but its not returning any data giving 200 success status but empty array.
Please let me know what i am missing
Thanks
curl --location 'https://{instance}/rest/api/3/search/jql?jql=issuetype = Epic ORDER BY created DESC' \ --header 'Authorization: Basic {api token}' \
Welcome @Chandra Kakkireni
When you run this query in your actual Jira, does it return any results?
@Chandra Kakkireni
Try something like this. curl --request GET \ --url '<a href="https://your-domain.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20HSP&nextPageToken=%3Cstring%3E&maxResults=100&fields=key,summary" target="_blank" rel="nofollow noopener noreferrer">https://your-domain.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20HSP&nextPageToken=%3Cstring%3E&maxResults=100&fields=key,summary</a>' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
curl --request GET \ --url '<a href="https://your-domain.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20HSP&nextPageToken=%3Cstring%3E&maxResults=100&fields=key,summary" target="_blank" rel="nofollow noopener noreferrer">https://your-domain.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20HSP&nextPageToken=%3Cstring%3E&maxResults=100&fields=key,summary</a>' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
Hi @Chandra Kakkireni ,
Please, find the attached document link which will correct way to perform the search using JQL.
https://confluence.atlassian.com/jirakb/how-to-return-issues-from-a-jql-query-using-rest-api-1289424308.html
Let me know if you have any issues.
Regards,
Mahesh Shinde
A couple of ideas:
If you can see the issues in Issue Navigator (eliminating any concerns about permissions), and you are getting a 200 status code -- I'm betting its the format of the JQL. You can also do another test by using a filter Id - e.g. search?jql=filter=99999.
Good luck
Thank you all. Issue was identified with help of Atlassian support team. Issue with Service account which i am using to get the data. Actually status was confused me as it returning statuscode=200 and empty array
HI Nikola, Yes i copied the jql from JIRA itself. There it is returning data but from postman returning empty array
Hi Vishal, I have tried with user header , but no response from JIRA.
Status : 200 OK{"issues":[]}
Try with these 2 changes
Thanks Vishal for your reply.
Initially I have tried this approach only, but didn't get any data for below as well.
curl --location 'https://instancename/rest/api/3/search/jql?jql=project%20%3D%20%22CEE%22%20AND%20issuetype%20%3D%20Epic%20ORDER%20BY%20created%20DESC' \--header 'Authorization: Basic {apitoken}' \
Hi Mahesh, i have followed same instructions exists in link, but no luck.
Previously we used to get the data using api/2/search but that api was deprecated.
Hi @Chandra Kakkireni
You are using Basic Auth where I can see token in postman page but username is missing, Can you check if you have added your user account in basic authentication?
Please, let me know if that's resolves your issues.
we construct the similar URL with 2/search/jql?jql I am only getting the ids, what is the way to get the complete JSON and want to use api 2 as I want description in 1 field value ?
Were you able to find a solution to this issue? Even I am facing the same problem with the new api search/jql, as the older APIs are now deprecated. If the issue is resolved, can you please share the code snippet which I can try as well. Thanks!
It looks like you're new here. Sign in or register to get started.