Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,777
Community Members
 
Community Events
168
Community Groups

How can I get the Sprint view for my rest API in Python?

I am using list comprehension to extract some Jira data, but this same technique doesn't work for the "Sprint" view

 

from jira.client import JIRA

from jira import JIRA

import pandas as pd
import snowflake.connector
from snowflake.connector.pandas_tools import write_pandas
#from snowflake.sqlalchemy import URL
#from sqlalchemy import create_engine
jiraOptions = {'server': "example.com"}

jira = JIRA(options=jiraOptions, basic_auth=("example.com", "False"))

 

size = 100
initial = 0
issue_key=[]

sum_list=[]
iss_type=[]
stat=[]
pri=[]
creat=[]
date=[]
sprint=[]
while True:
start= initial*size
issues = jira.search_issues('project = EBI ORDER BY createdDate DESC', start,size)
if len(issues) == 0:
break
initial += 1
for issue in issues:

key=issue.key
issue_key.append([key])

summ=issue.fields.summary
sum_list.append([summ])

i_type=issue.fields.issuetype.name
iss_type.append([i_type])

st=issue.fields.status.name
stat.append([st])

pr=issue.fields.priority.name
pri.append([pr])

cre=issue.fields.creator.displayName
creat.append([cre])

dt=issue.fields.created
date.append([dt])
spri=issue.sprint
sprint.append([spri])

 

AttributeError: <class 'jira.resources.Issue'> object has no attribute 'sprint' ('Issue' object is not subscriptable)

0 answers

Suggest an answer

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

Atlassian Community Events