Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count of subscribers to a GitHub issue?

Tags:

github

GitHub allows me to subscribe to issues but does the GitHub API allow me to determine the count of subscribers to an issue?

My thinking is that if the subscriber count were exposed it could be a form of voting for an issue. Right now, you often see people "voting" for issues by adding a "+1" or similar comment, which can clutter up an issue.

(There have been calls for an explicit +1 feature for issues that isn't a comment and browser extensions developed to declutter issues.)

I checked https://developer.github.com/v3/issues/ and it doesn't seem like determining the count of subscribers to an issue is currently possible, unfortunately.

like image 221
Philip Durbin Avatar asked Jul 17 '14 18:07

Philip Durbin


2 Answers

As the Github's API have not the exact feature that you are looking for, it is possible to fetch the data and look for suscribed events from the Issues Events API https://developer.github.com/v3/issues/events/

GET /repos/:owner/:repo/issues/:issue_number/events

Will fetch the list of events for particular issue, there you can check for subscribed values on the event field.

like image 142
Daniel Aristizabal Avatar answered Sep 23 '22 04:09

Daniel Aristizabal


You can now use Github graphql API to get the count of thumbs up (+1) 👍 reaction :

{
  repository(owner: "isaacs", name: "github") {
    issue(number: 9){
      reactions(content: THUMBS_UP){
        totalCount
      }
    }
  }
}

Output:

{
  "data": {
    "repository": {
      "issue": {
        "reactions": {
          "totalCount": 227
        }
      }
    }
  }
}

enter image description here

like image 1
Bertrand Martel Avatar answered Sep 20 '22 04:09

Bertrand Martel