# Buggy code
def annotations(self, issue, issue_obj):
    comments = self.jira.comments(issue.key) or []
    return self.build_annotations(
        ((comment.author.name, comment.body) for comment in comments),
        issue_obj.get_processed_url(issue_obj.get_url()),
    )


# Traceback (TypeError)
INFO:bugwarrior.db:Service-defined UDAs exist: you can optionally use the `bugwarrior-uda` command to export a list of UDAs you can add to your taskrc file.
INFO:bugwarrior.services:Starting to aggregate remote issues.
INFO:bugwarrior.services:Spawning 1 workers.
INFO:bugwarrior.services:Working on [JIRA]
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
INFO:bugwarrior.services.jira:Found 1 distinct sprint fields.
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
ERROR:bugwarrior.services:Worker for [JIRA] failed: <class 'jira.resources.UnknownResource'> object has no attribute 'name' ('UnknownResource' object is not subscriptable)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/jira/resources.py", line 161, in __getattr__
return self[item]
TypeError: 'UnknownResource' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/__init__.py", line 499, in _aggregate_issues
for issue in service.issues():
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/jira.py", line 352, in issues
'annotations': self.annotations(case, issue)
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/jira.py", line 335, in annotations
issue_obj.get_processed_url(issue_obj.get_url())
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/__init__.py", line 149, in build_annotations
for author, message in annotations:
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/jira.py", line 334, in <genexpr>
) for comment in comments),
File "/usr/local/lib/python3.7/site-packages/jira/resources.py", line 177, in __getattr__
raise AttributeError("%r object has no attribute %r (%s)" % (self.__class__, item, e))
AttributeError: <class 'jira.resources.UnknownResource'> object has no attribute 'name' ('UnknownResource' object is not subscriptable)
INFO:bugwarrior.services:Done with [JIRA] in 3.948460s
INFO:bugwarrior.services:Terminating workers
ERROR:bugwarrior.command:Aborted (critical error in target 'JIRA')
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/bugwarrior/command.py", line 73, in pull
synchronize(issue_generator, config, main_section, dry_run)
File "/usr/local/lib/python3.7/site-packages/bugwarrior/db.py", line 348, in synchronize
for issue in issue_generator:
File "/usr/local/lib/python3.7/site-packages/bugwarrior/services/__init__.py", line 568, in aggregate_issues
"critical error in target '{}'".format(target))
RuntimeError: critical error in target 'JIRA'

# Fixed code
def annotations(self, issue, issue_obj):
    comments = self.jira.comments(issue.key) or []
    return self.build_annotations(
        ((comment.author.displayName, comment.body) for comment in comments),
        issue_obj.get_processed_url(issue_obj.get_url()),
    )