User pr first contribution status

Is it possible to check through the api ( for example the pr endpoint) if the pr is the first contribution of this user on the repository?

1 Like

Hi @acrobat,

Thank you for being here! I suppose you could query the “First-time contributor” labels, using: https://developer.github.com/v3/issues/labels/ to start. 

1 Like

I’m indeed talking about the label in the PR header

But the label api doesn’t return this label for this pullrequest

@andreagriffiths11 any update on how to get this info through the api?

:wave: @acrobat - The GraphQL API has a CommentAuthorAssociation enum available. Enums represent possible sets of values for a field.

Let’s use this issue as an example, where you’re currently listed as a Collaborator:

You can use our GitHub GraphQL API Explorer to run the following query:

query {
  repository(owner: "KnpLabs", name: "php-github-api") {
    issue(number: 873) {
      author {
        login
      }
      authorAssociation
    }
  }
}

The API will respond with the appropriate information:

{
  "data": {
    "repository": {
      "issue": {
        "author": {
          "login": "acrobat"
        },
        "authorAssociation": "COLLABORATOR"
      }
    }
  }
}

Hope this helps! :v:

2 Likes

Thanks a lot @francisfuzz! This does indeed solve my question!

1 Like