Forums

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

JQL Parse Rest API not working

Sri IT Services LLC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2025

When calling the below JQL Api (postman / CURL / Python Jira module) I am getting the project TM does not exists.

The Project TM exists.

curl --location 'https://sriitservicesllc.atlassian.net/rest/api/3/jql/parse?validation=strict' \
--header 'Content-Type: application/json' \
--header 'Cookie: atlassian.xsrf.token=<removed>' \
--data '{
"queries": [
"project = \"TM\" and issuetype = \"Epic\""
]
}'  

Response

{
    "queries": [
        {
            "query": "project = \"TM\" and issuetype = \"Epic\"",
            "errors": [
                "The value 'TM' does not exist for the field 'project'."
            ]
        }
    ]
}
Python
2025-07-10 07:55:55,983 - INFO - Searching Jira for requirements with JQL: project = "TM" AND issuetype = "Epic"
2025-07-10 07:55:56,128 - ERROR - Failed to search for requirements with JQL "project = "TM" AND issuetype = "Epic"": The value 'TM' does not exist for the field 'project
Get Project
curl --location 'https://sriitservicesllc.atlassian.net/rest/api/3/project/TM' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <removed>' \
--header 'Cookie: atlassian.xsrf.token=<removed>'
returns the correct response back.
In UI when i do the JQL with above query i see the response coming back. 

1 answer

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
July 10, 2025

Hi @Sri IT Services LLC, welcome to the community.

Cookie: atlassian.xsrf.token=<removed>

It looks like you're trying to authenticate with an XSRF token, which isn't for authentication, so the API seems to think you're an anonymous user.

From https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-parse-post, validation is performed in the context of the current user. If the API call doesn't recognize you, it's likely that anonymous users lack permission to the TM project and can't view it.

Sri IT Services LLC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2025
JIRA_DOMAIN: str = os.environ.get('JIRA_DOMAIN', 'https://sriitservicesllc.atlassian.net')
JIRA_EMAIL: str = os.environ.get('JIRA_EMAIL', 'sriitservicesllc@outlook.com')
JIRA_API_TOKEN: str = os.environ.get('JIRA_API_TOKEN', '<REMOVED>')

jira = JIRA(server=jira_domain, basic_auth=(jira_email, jira_api_token))
jql: str = f'project = "TM" AND issuetype = "Epic"'

issues = jira.search_issues(jql, maxResults=100)
Error #
ERROR - Failed to search for requirements with JQL "project = "TM"": The value 'TM' does not exist for the field 'project'.


Sri IT Services LLC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2025

@Jim Knepley - ReleaseTEAM  we are setting the bas_auth, This code was working few days before the token which i was using before was working fine and the current token is what it is throwing error.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events