scott martin
scott martin

Reputation: 1293

Error when pulling data using JIRA Rest API based on created date

I am trying to query data using JIRA Rest API and trying to pull data based on created date.

Given below is what I am trying but it throws an error

JIRAError: JiraError HTTP 400 url: https://company.atlassian.net/rest/api/2/search?jql=True&startAt=0&validateQuery=True&maxResults=50

text: Error in the JQL Query: 'True' is a reserved JQL word. You must surround it in quotation marks to use it in a query. (line 1, character 1)

This is what I am trying to query:

jira = jira_login <- Establishes connection to JIRA Rest API
issues = jira.search_issues("created" >= '2020-06-01')

Upvotes: 0

Views: 402

Answers (1)

Lennart Steinke
Lennart Steinke

Reputation: 614

The problem is, that

issues = jira.search_issues("created" >= '2020-06-01')

evaluates to true (since the >= is outside the quotes, python will evaluate it, and then pass True to the function.

Try this:

issues = jira.search_issues("created >= \"2020-06-01\"")

Upvotes: 2

Related Questions