Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close an issue with GitHub API

I am trying to figure out how to close an issue through the Github API.

Specifically I'm trying to do it through pyGitHub and python, but knowing how to close an issue through the GitHub API would be enough to let me figure it out.

Can anyone point me in the right direction? I'm sure it's simple but I can't find it in the documentation

like image 230
Bar Smith Avatar asked Mar 30 '18 21:03

Bar Smith


People also ask

How do you close a pull request problem?

To unlink an issue that you linked using a keyword, you must edit the pull request description to remove the keyword. You can also use closing keywords in a commit message.

How do you close an issue with a commit?

To link a commit to a GitHub Issue, put the issue number with the # character in the Comment text box. For example, #111. To close a GitHub issue, put a keyword and put the issue number with the # character in the Comment text box. For example, Close #111.

What is close with comment in GitHub?

As of right now, the issues manager has a button named "Close and comment" for commenting and closing at the same time. However, you are actually commenting then closing the issue.


1 Answers

I did not tested this right away but I think it is possible to close an issue by using pyGitHub's edit function, which in turn relies on this entrypoint in GitHub API.

Basically it should suffice to set the state parameter to "closed".

like image 170
ErikMD Avatar answered Oct 11 '22 20:10

ErikMD