Closing issues via the Rest api as a triage member

Hi,

So I’m currently working on a little issue management app using the Github Rest API v3 and I’m attempting to use the app with a personal access token for now. The problem I’m having is when I try to use my app to apply labels or close issues on an org’s repo that I’m a Triage member of (actions I can do from the normal Github site as my user) I’m getting a 403 error:

Request:

PATCH https://api.github.com/repos/org/repo/issues/number

Payload

{"state":"closed","labels":["legacy code"]}

Response

{
"message": "Must have admin rights to Repository.",
"documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue"
}

I’m assuming this is because I’m only a Triage user of the org that I’m using my app with. This being said, I can still do it through my Github account. Anyone able to shead some light on this?

Thanks in advance.

According to the help doc the Triage role only allows you to close issues that you opened.

@michaelhillcox I’m curious if you can try the following:

  1. Attempt to close the issue without including labels in the payload.
  2. Add labels to an existing issue.

I’m currently unable to add labels to an existing issue with the Triage role which led me to this post. I also see the “Must have admin rights to Repository” error.

1 Like

Unfortunatly, as you can see in that same table, it shows that you can also

Close, reopen, and assign all issues and pull requests

Which is the issue I’ve found here, I ended up requesting the write permission from the owners of the Org, lucky, they trusted me enough to do that for me in this instance the real issue here is that the API is not allowing us to do what we can do with out accounts when we’re on the site. Which kinda goes against the purpose of the API.

A few months back they fixed some of the issues related here in this post but failed to fix the closing issue. This is why I consider this to be a bug in their backend code.

Regarding your questions:

  1. I did attempt to close an issue without including labels, I also attempted a lot of other things which drove me to making a test Org under a different account just to investigate this issue more.
  2. The update I linked above allows for labeling now but still no delete.