Skip to content

For issues, get field state_reason to distinguish issues closed as not_planned #495

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

Closed
Tracked by #6699
andreasabel opened this issue Jun 23, 2023 · 0 comments · Fixed by #496
Closed
Tracked by #6699

For issues, get field state_reason to distinguish issues closed as not_planned #495

andreasabel opened this issue Jun 23, 2023 · 0 comments · Fixed by #496
Assignees
Milestone

Comments

@andreasabel
Copy link
Member

andreasabel commented Jun 23, 2023

For issues, get field state_reason to distinguish issues closed as not_planned.
This amounts to a new enum type IssueStateReason and a new field in Issue which should be parsed here:

instance FromJSON Issue where
parseJSON = withObject "Issue" $ \o -> Issue
<$> o .:? "closed_at"
<*> o .: "updated_at"
<*> o .: "events_url"
<*> o .: "html_url"
<*> o .:? "closed_by"
<*> o .: "labels"
<*> o .: "number"
<*> o .: "assignees"
<*> o .: "user"
<*> o .: "title"
<*> o .:? "pull_request"
<*> o .: "url"
<*> o .: "created_at"
<*> o .: "body"
<*> o .: "state"
<*> o .: "id"
<*> o .: "comments"
<*> o .:? "milestone"

According to https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue the possible values are

  • completed
  • not_planned
  • reopened
  • null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant