Github api to get issues with labels not using an OR? #120323
Replies: 3 comments 2 replies
-
@TannerS Yes, you can use the GitHub API to search for issues with specific labels in a repository. For example, to search for issues labeled as "bug" or "enhancement" in your repository, you can use the following command: curl -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/search/issues?q=repo:eddysantiagoo/Portafolio-Eddy+label:bug,enhancement" This command will return a JSON object containing all issues in my repo eddysantiagoo/Portafolio-Eddy repository that have either the "bug" label or the "enhancement" label For more info you can read https://docs.github.com/en/enterprise-cloud@latest/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests for more specific info If the answer helps you please mark this answer as the correct answer |
Beta Was this translation helpful? Give feedback.
-
Ah so instead of using the labels param your using a query param. Would pagination still work with that as well?
Sent from my T-Mobile 5G Device
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Eddy ***@***.***>
Sent: Saturday, April 20, 2024 1:30:35 AM
To: community/community ***@***.***>
Cc: Tanner Summers ***@***.***>; Mention ***@***.***>
Subject: Re: [community/community] Github api to get issues with labels not using an OR? (Discussion #120323)
@TannerS<https://github.com/TannerS> Yes, you can use the GitHub API to search for issues with specific labels in a repository. For example, to search for issues labeled as "bug" or "enhancement" in your repository, you can use the following command:
curl -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/search/issues?q=repo:eddysantiagoo/Portafolio-Eddy+label:bug,enhancement"
This command will return a JSON object containing all issues in my repo eddysantiagoo/Portafolio-Eddy repository that have either the "bug" label or the "enhancement" label
For more info you can read ***@***.***/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests for more specific info
If the answer helps you please mark this answer as the correct answer
—
Reply to this email directly, view it on GitHub<#120323 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACDUUD3XLMTBXEHKCRKPK7TY6IDQXAVCNFSM6AAAAABGQEUXBCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TCNZSGY3TE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok so that's the only way to get multiple labels as an OR?
My goal is to be able to search and filter issues by label with pagination. I know grapql could maybe do it but a bit harder to work with
Sent from my T-Mobile 5G Device
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Eddy ***@***.***>
Sent: Saturday, April 20, 2024 10:13:20 AM
To: community/community ***@***.***>
Cc: Tanner Summers ***@***.***>; Mention ***@***.***>
Subject: Re: [community/community] Github api to get issues with labels not using an OR? (Discussion #120323)
I don't think that pagination will be works, maybe you have to do it manually
—
Reply to this email directly, view it on GitHub<#120323 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACDUUD7EIRTQOEKFQYMO57LY6KAZBAVCNFSM6AAAAABGQEUXBCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TCNZUHA2TC>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I found this https://github.blog/changelog/2021-08-02-search-issues-by-label-using-logical-or/ but is there something equivalent for the github api / github enterprise api?
Beta Was this translation helpful? Give feedback.
All reactions