Skip to content

Commit 3e7e3b7

Browse files
committed
example, add _Comment helper
1 parent 9661223 commit 3e7e3b7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

examples/basic_use.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# Find all comments made by Atlassians on this issue.
2121
atl_comments = [
2222
comment
23-
for comment in issue.fields.comment.comments # type: ignore # FIXME: .comments?
24-
if re.search(r"@atlassian.com$", comment.author.emailAddress)
23+
for comment in issue.fields.comment.comments
24+
if re.search(r"@atlassian.com$", comment.author.key)
2525
]
2626

2727
# Add a comment to the issue.

jira/resources.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,13 @@ class Issue(Resource):
543543
"""A Jira issue."""
544544

545545
class _IssueFields(object):
546+
class _Comment(object):
547+
def __init__(self) -> None:
548+
self.comments: Optional[List[Comment]] = None
549+
546550
def __init__(self):
547551
self.attachment: Optional[List[Attachment]] = None
548-
self.comment: Optional[List[Comment]] = None
552+
self.comment = self._Comment()
549553
self.description: Optional[str] = None
550554
self.issuelinks: Optional[List[IssueLink]] = None
551555
self.labels: Optional[List[str]] = None
@@ -566,7 +570,7 @@ def __init__(
566570
if raw:
567571
self._parse_raw(raw)
568572

569-
def update( # type: ignore # incompatible supertype ignored
573+
def update( # type: ignore[override] # incompatible supertype ignored
570574
self,
571575
fields: Dict[str, Any] = None,
572576
update: Dict[str, Any] = None,

0 commit comments

Comments
 (0)