MCPcopy
hub / github.com/PyGithub/PyGithub / add_to_assignees

Method add_to_assignees

github/PullRequest.py:963–978  ·  view source on GitHub ↗

:calls: `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees `_

(self, *assignees: github.NamedUser.NamedUser | str)

Source from the content-addressed store, hash-verified

961 return github.PullRequestMergeStatus.PullRequestMergeStatus(self._requester, headers, data)
962
963 def add_to_assignees(self, *assignees: github.NamedUser.NamedUser | str) -> None:
964 """
965 :calls: `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees <https://docs.github.com/en/rest/issues/assignees?apiVersion=2022-11-28#add-assignees-to-an-issue>`_
966 """
967 assert all(isinstance(element, (github.NamedUser.NamedUser, str)) for element in assignees), assignees
968 post_parameters = {
969 "assignees": [
970 assignee.login if isinstance(assignee, github.NamedUser.NamedUser) else assignee
971 for assignee in assignees
972 ]
973 }
974 headers, data = self._requester.requestJsonAndCheck(
975 "POST", f"{self.issue_url}/assignees", input=post_parameters
976 )
977 # Only use the assignees attribute, since we call this PR as an issue
978 self._useAttributes({"assignees": data["assignees"]})
979
980 def remove_from_assignees(self, *assignees: github.NamedUser.NamedUser | str) -> None:
981 """

Callers

nothing calls this directly

Calls 2

_useAttributesMethod · 0.95
requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected