[Jira-Python] How can we fetch the commentor name by passing object?

Hi, I'm trying fetch the data of commentor name in the recently updated issue. I'm saving the updated issues in a list, when I'm passing the list in the query it gives me : AttributeError: type object 'PropertyHolder' has no attribute 'comment', even though there is comment present on the issue.

Can anyone please help?

Below is the code

def issue_tested(project_name, updated_from, updated_to):
    print project_name, updated_from, updated_to
    total_update=[]
    total_update = jira.search_issues('project = %s AND updated >= %s and updated <= %s' % (project_name, updated_from, updated_to))
    total_updated_length = len(total_update)
   
    print total_update
    print total_updated_length
    print total_update[2]
    issue = jira.issue(total_update[2])
    print issue
    print issue.fields.comment.comments[0].author.name

 

I'm getting the issue , but it is not getting passed in the print issue.fields.comment.comments[0].author.name. However when I directly assign the issue like : issue = jira.issue('Issue_name'), it gives me the author name. But while passing it as an object shows Attribute errror.

 

PS: I don't want to use Script-Runner as it as paid now, can you please give me any solution within python?

Thanks!

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,316 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot