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
Highlighted

Fetch author name of comment Edited

Unable to get author name 

 

author_name=issue.fields.comment.comments[0].author.name

 it gives below error:

author_name=issue.fields.comment.comments[0].author.name
File "C:\Users\mister\PycharmProjects\MyFirstProjest\venv\lib\site-packages\jira\resources.py", line 173, in __getattr__
if hasattr(self, 'raw') and item in self.raw:
TypeError: argument of type 'NoneType' is not iterable

2 comments

Payne Community Leader Aug 15, 2019

Perhaps your issue has no comments, so you need to test for that condition. Your syntax works for me for an issue that has at least one comment, but for an issue with no comment, I get an error, though a different one:

Traceback (most recent call last):
File "jiratest.py", line 43, in <module>
print (issue.fields.comment.comments[0])
IndexError: list index out of range

Like Mohamed Benziane likes this

The ticket has multiple comments,

Same code is working for different project 

I don't know why is it not working with this project

Comment

Log in or Sign up to comment
TAGS

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