Skip to content
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

Support state_reason in IssuesService.Edit #2393

Closed
parkr opened this issue Jun 21, 2022 · 3 comments · Fixed by #2395
Closed

Support state_reason in IssuesService.Edit #2393

parkr opened this issue Jun 21, 2022 · 3 comments · Fixed by #2395
Assignees

Comments

@parkr
Copy link
Contributor

parkr commented Jun 21, 2022

I would like to be able to use the API to close an issue with a reason why like you can in the UI (https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/ , https://github.blog/changelog/2022-03-10-the-new-github-issues-march-10th-update/ ). I looked at the Issues API documentation and couldn't find reference to these closing reasons (https://docs.github.com/en/rest/issues/issues#update-an-issue) but I contacted support and they stated:

The API now supports closing issues with state reasons. I'd reach out to the docs team to help update this in the API documentation.

Here is a sample query you can run:

curl -X PATCH -H "Accept: application/vnd.github.v3+json" -H "Authorization: token {TOKEN}" https://api.github.com/repos/{org_name}/{repo_name}/issues/{issue-id} -d '{"state":"closed","state_reason":"not_planned"}'

"state_reason" can either be completed or not_planned.

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 21, 2022

Wonderful, @parkr - thank you for your due diligence in contacting GitHub tech support!

Would you like to create a PR, or shall I open this issue up to other contributors to this repo to implement?

@parkr
Copy link
Contributor Author

parkr commented Jun 21, 2022

I would like to tackle the issue myself, but I won't hold it against anyone if they get to it first.

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 21, 2022

I would like to tackle the issue myself, but I won't hold it against anyone if they get to it first.

No rush, @parkr, and thank you! The issue is yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants