I'm trying to do some manipulation of tickets in JIRA cloud using the python API - something I have done before but we have sinced switched to gsuite and google logins.
from jira import JIRA
I am logging in using an email/APIKey combo
Jira_username = args.username //set as email address in the args
Jira_password = args.password // set as token key in args
append_log(log_file, "Connecting to JIRA", args.logging, verbose, message_level=1)
jira = JIRA(jira_options, basic_auth=(Jira_username, Jira_password), )
except Exception as ex:
append_log(log_file, "JIRA connection Failed with Exception: %s" % ex.message, args.logging, verbose, message_level=1)
This all appears to works fine
When I try to do a search however, using JQL that works in the web browser:
JQL_Filter = "remainingEstimate is not EMPTY AND statusCategory != Done AND Team not in (15, 43, 16)"
append_log(log_file, "Searching for issues with filter: ' %s ' " % JQL_Filter, args.logging, verbose, message_level=2)
List_Of_Jiras = jira.search_issues(JQL_Filter)
At this point I get
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://[COMPANY].atlassian.net/rest/api/2/search?jql=remainingEstimate+is+not+EMPTY+AND+statusCategory+%21%3D+Done+AND+Team+not+in+%2815%2C+43%2C+16%29&validateQuery=True&startAt=0&maxResults=50
text: Field 'remainingEstimate' does not exist or this field cannot be viewed by anonymous users.
I get the same if I just restrict the JQL to "team = 14" or similar
(ps, have put [Company] in manually for obvious reasons)
I don't know Python because I use C# for my APIs, but are you able to do a very simple query?
e.g. just use
without any extra parameters. What does that do?
If that works, then it would point to your JQL, so try building the JQL up slowly - use
jql=remainingEstimate is not EMPTY
BTW the error message may not be totally accurate - if any part of the JQL is at fault, you may get the same message
When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event