I'm using PyGithub to interact with GitHub API and trying to get assignees and assigner on issues. I implemented the following code, and it seem that assignee name and assigner name are not correct. For instance, clatoolkitdev2
was assigned by clatoolkitdev
on issue #32. However, I got clatoolkitdev2
as assignee and assigner from my code.
gh = Github(login_or_token = token, per_page = self.parPage)
repo = gh.get_repo(repo_name)
issue = repo.get_issue(issue_number)
issue_events = issue.get_events().get_page(page)
for event in issue_events:
assignee = event.issue.assignee
assigner = event.actor
assigner_id = str(assigner.id)
assigner_name = str(assigner.login)
assignee_name = assignee.login
print '================================================================='
print 'event ID: ' + str(event_id) + " " + issue_url
print 'assigner: %s assignee: %s' % (assigner_name, assignee_name)
The output:
=================================================================
event ID: 866189924 https://github.com/clatoolkitdev/GitHubIntegrationTest/issues/32
assigner: clatoolkitdev2 assignee: clatoolkitdev2
=================================================================
event ID: 803384175 https://github.com/clatoolkitdev/GitHubIntegrationTest/issues/25
assigner: kojiclatoolkit assignee: kojiclatoolkit
=================================================================
event ID: 803384176 https://github.com/clatoolkitdev/GitHubIntegrationTest/issues/25
assigner: clatoolkitdev assignee: kojiclatoolkit
=================================================================
event ID: 852475091 https://github.com/clatoolkitdev/GitHubIntegrationTest/issues/24
assigner: kojiclatoolkit assignee: kojiclatoolkit
=================================================================
event ID: 852475092 https://github.com/clatoolkitdev/GitHubIntegrationTest/issues/24
assigner: clatoolkitdev assignee: kojiclatoolkit
I checked PyGithub API reference and googled to find a solution but didn't get any clue. I was wondering whether I made stupid mistakes or there is a bug in PyGithub.