Hello! I'm trying to do a JQL search through python, but having problems. I've successfully used the API to access a single issue, so I know the authentication is okay.
This works in my browser: https://<base-url>.atlassian.net/rest/api/3/search?jql=project = "CHOR" AND due >= "2025-04-07" AND due <= "2025-04-13" ORDER BY created DESC
And this is my python code (I simplified the JQL in case that was the issue):
searchURL = 'https://<base-url>.atlassian.net/rest/api/3/search'
jql = 'project = "CHOR"'
urlJQL = searchURL + '?jql=' + jql
auth = HTTPBasicAuth(email, token)
headers = {
"Accept": "text/html,application/json",
"Content-Type": "application/json"}
response = requests.request( "POST", urlJQL, headers=headers, auth=auth )
And the response I get is:
{'errorMessages': ['No content to map to Object due to end of input']}
Can somewhat help me figure out what I'm missing?
I would guess it is one of two things:
Here is what the final header looks like
Authorization=Basic ZG5pY2tlbGxAc.......aRHFFMUxUNnpmNEZlclZJPUMwOTdEREFF
If this doesn't fix it --- feel free to plug your praramters into my excel sheet on my website (splitdimedata.com). that might help you determine if your API key is the issue.
Thanks
The GET was the issue! I had originally thought that searching with JQL was a post and I guess I never fixed that part of it. Thank you so much :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I may add something to this:
There are 2 methods for the search endpoint: POST and GET.
With GET you need to use the query parameter like you did. With POST you need to use the request body, that's why the POST did not work for you.
I can also recommend using /rest/api/3/search/jql instead of /rest/api/3/search. The latter has been deprecated.
Link to the GET endpoint to be used: The Jira Cloud platform REST API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online 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.