It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

API import issue when the field is empty

Johann Taljaard Sep 28, 2016

I am using the JIRA API to pull ticket details and put it in a separate database that I can connect Tableau to.

My problem is that when pulling in a ticket details (using python) where e.g. it has no priority, that I get an error.

How do I get around that error? How can I handle this error?

 

Just currently testing by printing the details on-screen:

 

for issue in issues:
if verbose:
            print( "issue.key: ", issue.key );
            print( "issue.fields.project.id: ", issue.fields.project.id );

The error I get is: 

cursor.execute(sql_stmt, (issue.key, issue.fields.issuetype.name, issue.fields.project.name, issue.fields.summary, issue.fields.updated,issue.fields.priority.name))
AttributeError: type object 'PropertyHolder' has no attribute 'priority

 

 

1 answer

0 votes
Johann Taljaard Sep 28, 2016

The following worked for me:

if verbose:
try:
print( "issue.key: ", issue.key );
print( "issue.fields.project.id: ", issue.fields.project.id );
except AttributeError:
 key = None

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in United States

Topic Tuesday: Agile

Another week, another Topic Tuesday!  Agile has been on my mind a lot lately because I've seen good implementations and bad implementations, but now as a Jira admin it matters more to me whether...

13 views 0 0
View post

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you