Search across repositories?

Is it possible to search for issues across all repositories? For example on the global “Issue Distribution” report it shows x number of Sql issues. However I am unable to find which repos these issues belong to.

Can I query with the API or something like that?

Hey @shawn – You can use the API to get the list of repositories [1] and fetch the issues in the default branch of the repository [2] along with it’s category, shortcode, severity [3].

[1] Account
[2] Repository
[3] Issue

Thanks jai, however I have generated a PAT for both the owner and my own account. I am able to run the following:

query {
viewer {
id
firstName
lastName
email
}
}

and this returns the correct value, however when running :
query {
account(login: “XXXXXX”, vcsProvider: GITHUB) {
login
id
type
vcsProvider
vcsUrl
avatarUrl
}
}

with either user and either PAT I always get a response of:

Owner matching query does not exist.

Do you know what I am missing?

1 Like

After running some other queries, I did find the problem. The login is not the user login but the team name. Also we are using DevOps so the vcsProvider is ADS.

@jai Do you happen to have an example on how to perform paging (or other arguments) in the GraphQL query? I thought this syntax would be correct:

query {
account(login: “XXXX”, vcsProvider: ADS) {
login
id
type
vcsProvider
vcsUrl
#avatarUrl
repositories {
pageInfo(startCursor: “XXXX”){
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
}

However the error is: Unknown argument "startCursor" on field "pageInfo" of type "RepositoryConnection".

Thanks

1 Like