Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,558,097
Community Members
 
Community Events
184
Community Groups

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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
AUG Leaders

Atlassian Community Events