GitHub API - how to move an issue to a project?

别来无恙 提交于 2021-02-19 04:32:42

问题


There are several ways to move a Github issue to a Project board through the GitHub user interface, but there doesn't seem to be any way to do this via the API (either v3 or v4). Is this missing functionality?


回答1:


You can:

  • create a project card: POST /projects/columns/:column_id/cards
  • move a project card: POST /projects/columns/cards/:card_id/moves

That is:

  • The first one allows you to associate an issue to a project card,

content_id: The issue or pull request id you want to associate with this card. You can use the List issues for a repository and List pull requests endpoints to find this id.
Note: Depending on whether you use the issue id or pull request id, you will need to specify Issue or PullRequest as the content_type.

  • the second one allows you to move a card (and its associated issue)

Those two calls ought to be enough.


The OP Ken Liu asked in the comments if there is any way to add an issue to a project without adding it to a project column.

seth suggests:

You can add an issue to the repo using code (GitHub API) as per creating an issue



来源:https://stackoverflow.com/questions/57024087/github-api-how-to-move-an-issue-to-a-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!