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%20%3D%20Epic%20ORDER%20BY%20created%20DESC' \ --header 'Authorization: Basic {api token}' \
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chandra Kakkireni ,
Please, find the attached document link which will correct way to perform the search using JQL.
Let me know if you have any issues.
Regards,
Mahesh Shinde
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Regards,
Mahesh Shinde
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try something like this. curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20HSP&nextPageToken=%3Cstring%3E&maxResults=100&fields=key,summary' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal, I have tried with user header , but no response from JIRA.
Status : 200 OK
{"issues":[]}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try with these 2 changes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}' \
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please add below 2
--request GET
--header 'Accept: application/json'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my working curl. replace <your instance> and <encode_token>
This should work
curl --request GET \
--url 'https://<your instance>.atlassian.net/rest/api/3/search/jql?jql=project=CEE%20AND%20issuetype=Epic&maxResults=100&fields=summary%2Ccomment&expand=name' \
--header 'Accept: application/json' \
--header 'Authorization: Basic <encode_token>' \
--header 'content-type: application/json'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal, I have used same in postman but no luck.
The Problem was it giving empty array, same JQL giving data at JIRA website level.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you show the screen shot of your params?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and make sure body is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes body is empty, and in params only jql was there like below image
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in params key, value add
maxResults 100
fields key,summary
and see if it makes a difference.
When you run the curl command in unix shell or git bash shell are you getting any output?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome @Chandra Kakkireni
When you run this query in your actual Jira, does it return any results?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Nikola, Yes i copied the jql from JIRA itself. There it is returning data but from postman returning empty array
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.