-
- Notifications
You must be signed in to change notification settings - Fork 895
Add notify to comment #1387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notify to comment #1387
Changes from all commits
dd94622 beea1b6 d21b1a2 aeed961 eac32b7 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -763,14 +763,45 @@ def __init__( | |
| self._parse_raw(raw) | ||
| self.raw: Dict[str, Any] = cast(Dict[str, Any], self.raw) | ||
| | ||
| def update(self, fields=None, async_=None, jira=None, body="", visibility=None): | ||
| """Update a comment""" | ||
| data = {} | ||
| def update( # type: ignore[override] | ||
| # The above ignore is added because we've added new parameters and order of parameters is different. | ||
| # Will need to be solved in a major version bump. | ||
| self, | ||
| fields: Optional[Dict[str, Any]] = None, | ||
| async_: Optional[bool] = None, | ||
| jira: "JIRA" = None, | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more for myself, but why the quotes around JIRA? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because we only import the Some more reading here: https://mypy.readthedocs.io/en/stable/runtime_troubles.html#annotation-issues-at-runtime | ||
| body: str = "", | ||
| visibility: Optional[Dict[str, str]] = None, | ||
| is_internal: bool = False, | ||
| notify: bool = True, | ||
| ): | ||
| """Update a comment | ||
| | ||
| Keyword arguments are marshalled into a dict before being sent. | ||
| | ||
| Args: | ||
| fields (Optional[Dict[str, Any]]): DEPRECATED => a comment doesn't have fields | ||
| async_ (Optional[bool]): If True the request will be added to the queue, so it can be executed later using async_run() | ||
| jira (jira.client.JIRA): Instance of Jira Client | ||
| visibility (Optional[Dict[str, str]]): a dict containing two entries: "type" and "value". | ||
| "type" is 'role' (or 'group' if the Jira server has configured | ||
| comment visibility for groups) and 'value' is the name of the role | ||
| (or group) to which viewing of this comment will be restricted. | ||
| body (str): New text of the comment | ||
| is_internal (bool): Defines whether a comment has to be marked as 'Internal' in Jira Service Desk (Default: False) | ||
| notify (bool): Whether to notify users about the update. (Default: True) | ||
| """ | ||
| data: Dict[str, Any] = {} | ||
| if body: | ||
| data["body"] = body | ||
| if visibility: | ||
| data["visibility"] = visibility | ||
| super().update(data) | ||
| if is_internal: | ||
| data["properties"] = [ | ||
| {"key": "sd.public.comment", "value": {"internal": is_internal}} | ||
| ] | ||
| | ||
| super().update(async_=async_, jira=jira, notify=notify, fields=data) | ||
| | ||
| | ||
| class RemoteLink(Resource): | ||
| | ||
Uh oh!
There was an error while loading. Please reload this page.