【发布时间】:2022-01-15 06:07:24
【问题描述】:
是否可以使用 github API 将问题添加到项目板?
本文档: https://docs.github.com/en/rest/reference/projects#create-a-project-card 表明这是可能的,但我使用 https://github.com/fastai/ghapi 的尝试失败了。
我试过了:
api.projects.create_card(col.id, note=f'{issue.title} {issue.html_url}', content_id=issue.id)
但该卡不显示为问题卡,它显示为引用问题的卡 - 这是不同的。
我也试过了:
curl -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/projects/columns/####/cards -d '{"column_id": colid, "content_id": cid, "content_type": "json"}' -u user:$GITHUB_TOKEN
这给出了一个错误:
{
"message": "Validation Failed",
"errors": [
{
"resource": "ProjectCard",
"code": "unprocessable",
"field": "data",
"message": "Could not resolve to a node with the global id of 'XXXXXXXXXX'."
}
],
"documentation_url": "https://docs.github.com/v3/projects/cards/#create-a-project-card"
}
这表明我搞砸了 curl 请求,但我不确定在哪里。
【问题讨论】:
标签: github-api