Hello!
By reading some other discussions here on the community, and in other sites, I've wrote a few python codes trying to get my Jira information into a dataframe and use it. Let me show some attempts:
#1
import requests
import json
url = 'https://URL.atlassian.net/rest/api/3/search?jql=project%20%3D%20PROJECTNAME%20ORDER%20BY%20updated%20DESC&maxResults=100&startAt=0&fields=*all,-comment'
header = {
"Autenticate": "TOKEN"
}
request = requests.get(url, headers=header)
resp = json.loads(request.content)
print(resp)
#2
from jira import JIRA
jira = JIRA(basic_auth=('USER', 'PASS'), options={'server':'https://URL.atlassian.net'})
def get_all_issues(jira_client, project_name, fields):
issues = []
i = 0
chunk_size = 100
while True:
chunk = jira_client.search_issues(f'project = {project_name}', startAt=i, maxResults=chunk_size, fields=fields)
i += chunk_size
issues += chunk.iterable
if i >= chunk.total:
break
return issues
issues = get_all_issues(jira, 'PROJECTNAME', ["id", "fixVersion"])
#3
from jira import JIRA
jira = JIRA(server='https://URL.atlassian.net', basic_auth=('USER', 'PASS))
issue = jira.issue('PROJECTNAME-xxx')
print(issue.fields.summary)
#4
from atlassian import Jira
jira = Jira(
url='https://URL.atlassian.net',
username='USER',
password='PASS',
cloud=True)
JQL = 'project = PROJECTNAME ORDER BY updated DESC'
data = jira.jql(JQL)
print(data)
In all of these i got the error (or similar):
{"errorMessages":["The value 'PROJECTNAME' does not exist for the field 'project'."],"warningMessages":[]}
What is missing from my code to connect to the API and get all issues on my project? (about 4k issues there that i'm trying to analyse)