Hello,
I'm trying to create an issue using the jira/JIRA python library. I've got it to connect with token_auth, but I'm now getting a JiraError HTTP 404 'No project found'. Copy-pasting the exact path from the error into google, I get a successful HTML readout (showing the project owner, key, etc.). My code is below:
#Some of the below imports unused/used in other parts of the code
import requests
from requests.auth import HTTPBasicAuth
import urllib.request
import json
from jira import JIRA
import pandas
from collections import defaultdict
import xlsxwriter
#code to import from another API into a dict, want to parse parts of this dict into jira eventually
options = {
'server': 'https://its.<mywebsite>.com',
'verify': True
jira = JIRA('https://its.<mywebsite>.com')
auth_jira = JIRA(options=options, token_auth=('<myuser>@<mywebsite>.com', '<api_token>'))
new_issue = jira.create_issue(project='TESTPROJ', summary='New issue from jira-python', description='Look into this one', issuetype={'name': 'Task'})
And below is the error I get:
JIRAError: JiraError HTTP 404 url: https://its.<mywebsite>.com/rest/api/2/project/TESTPROJ
text: No project could be found with key 'TESTPROJ'.
response headers = {'Date': 'Thu, 02 Nov 2023 16:36:29 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '<cookie>'; Expires=Thu, 09 Nov 2023 16:36:29 GMT; Path=/, '<some_path>'; Expires=Thu, 09 Nov 2023 16:36:29 GMT; Path=/; SameSite=None; Secure', 'X-AREQUESTID': '<data>', 'X-ANODEID': '<data>', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Security-Policy': 'sandbox', 'Strict-Transport-Security': 'max-age=31536000', 'X-AUSERNAME': 'anonymous', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Encoding': 'gzip', 'Vary': 'User-Agent'}
response text = {"errorMessages":["No project could be found with key 'TESTPROJ'."],"errors":{}}
I redacted whatever I thought might've warranted redaction, sorry if I took something important out.
I'm thinking the problem might reside in the 'its...' part of the url, but using any of the urls I've seen in other documentation ('<mysite>.atlassian.net' or 'jira.<mysite>.com') does not connect for both python and in google. Hoping this doesn't mean I will not be able to connect.
I've tried using the HTTPRequests method, but could not get it to not error out before even pinging the server, let alone getting a response, so I'd appreciate help related to this library if possible. Thanks for any help in advance.