Skip to content

Adding labels to Issues via API #7280

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
1 of 7 tasks
bobemoe opened this issue Jun 23, 2019 · 1 comment
Closed
1 of 7 tasks

Adding labels to Issues via API #7280

bobemoe opened this issue Jun 23, 2019 · 1 comment

Comments

@bobemoe
Copy link
Contributor

bobemoe commented Jun 23, 2019

  • Gitea version (or commit ref): 1.9.0+dev-370-gde9b398cd
  • Git version: 1:2.11.0-3+deb9u4
  • Operating system: Devuan Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I've tried using PATCH to
https://gitea.local/api/v1/repos/USER/REPO/issues/1

with post fields:

  • {"labels":[73]}
  • {"labels":73}
  • {"labels":['name']}
  • {"labels":'name'}
  • {"label":[73]}
  • {"label":73}
  • {"label":['name']}
  • {"label":'name'}

The issue is returned but no label has been added to it, much like #5435 but that is for a PR not Issue.

Label 73:"name" does exist on the repo. I can manually add it.

Am I using wrong post data? Wasn't sure to use name or id or array? Should this work? Thanks.

@bobemoe
Copy link
Contributor Author

bobemoe commented Jun 23, 2019

Turns out there is another API endpoint specifically for labels. Had success with:
POST /repos/{owner}/{repo}/issues/{index}/labels
with post fields {"labels": [73]}

@bobemoe bobemoe closed this as completed Jun 23, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant