github - Github:如何列出问题的里程碑更新
问题描述
如何为特定工单列出当前里程碑及其先前分配的里程碑(如果适用)(+ 每个里程碑更新的日期)?我签入了 github API ( https://developer.github.com/v3/issues/#get-a-single-issue ),我可以提取当前里程碑,但不能提取之前分配的里程碑(如果它们存在)。任何想法 ?
谢谢,
解决方案
您可以使用问题事件 API。为了测试这一点,我去了一个测试问题,并且:
- 添加里程碑
new
- 添加里程碑
two
在使用该端点查询 API 后,我得到了三个事件,两个带有 typemilestoned
和一个demilestoned
。端点允许您过滤这些事件,专门用于消除非常活跃的问题上的噪音。这是回复的示例(带有混淆数据)
[
{
"id": 2193329921,
"url": "https://api.github.com/repos/myOrg/myRepo/issues/events/2193329921",
"actor": {
"login": "myuser",
"id": 1192590,
"node_id": "MDQ6VXNlcjExOTI1OTA=",
"gravatar_id": "",
"url": "https://api.github.com/users/myuser",
"html_url": "https://github.com/myuser",
"followers_url": "https://api.github.com/users/myuser/followers",
"following_url": "https://api.github.com/users/myuser/following{/other_user}",
"gists_url": "https://api.github.com/users/myuser/gists{/gist_id}",
"starred_url": "https://api.github.com/users/myuser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/myuser/subscriptions",
"organizations_url": "https://api.github.com/users/myuser/orgs",
"repos_url": "https://api.github.com/users/myuser/repos",
"events_url": "https://api.github.com/users/myuser/events{/privacy}",
"received_events_url": "https://api.github.com/users/myuser/received_events",
"type": "User",
"site_admin": true
},
"event": "milestoned",
"commit_id": null,
"commit_url": null,
"created_at": "2019-03-11T09:42:00Z",
"milestone": {
"title": "new"
}
},
{
"id": 2193330104,
"url": "https://api.github.com/repos/myOrg/myRepo/issues/events/2193330104",
"actor": {
"login": "myuser",
"id": 1192590,
"url": "https://api.github.com/users/myuser",
"html_url": "https://github.com/myuser",
"followers_url": "https://api.github.com/users/myuser/followers",
"following_url": "https://api.github.com/users/myuser/following{/other_user}",
"gists_url": "https://api.github.com/users/myuser/gists{/gist_id}",
"starred_url": "https://api.github.com/users/myuser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/myuser/subscriptions",
"organizations_url": "https://api.github.com/users/myuser/orgs",
"repos_url": "https://api.github.com/users/myuser/repos",
"events_url": "https://api.github.com/users/myuser/events{/privacy}",
"received_events_url": "https://api.github.com/users/myuser/received_events",
"type": "User",
"site_admin": true
},
"event": "demilestoned",
"commit_id": null,
"commit_url": null,
"created_at": "2019-03-11T09:42:04Z",
"milestone": {
"title": "new"
}
},
{
"id": 2193330105,
"url": "https://api.github.com/repos/myOrg/myRepo/issues/events/2193330105",
"actor": {
"login": "myuser",
"url": "https://api.github.com/users/myuser",
"html_url": "https://github.com/myuser",
"followers_url": "https://api.github.com/users/myuser/followers",
"following_url": "https://api.github.com/users/myuser/following{/other_user}",
"gists_url": "https://api.github.com/users/myuser/gists{/gist_id}",
"starred_url": "https://api.github.com/users/myuser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/myuser/subscriptions",
"organizations_url": "https://api.github.com/users/myuser/orgs",
"repos_url": "https://api.github.com/users/myuser/repos",
"events_url": "https://api.github.com/users/myuser/events{/privacy}",
"received_events_url": "https://api.github.com/users/myuser/received_events",
"type": "User",
"site_admin": true
},
"event": "milestoned",
"commit_id": null,
"commit_url": null,
"created_at": "2019-03-11T09:42:04Z",
"milestone": {
"title": "second"
}
}
]
推荐阅读
- python - jupyter lab replwrap.py ValueError: 找到继续提示
- python - Python Dataframe Groupby 均值和标准差
- flutter - 颤动下拉菜单
- pine-script - 版本 4 和 2 松脚本之间的 14 个烛台差异
- cmd - 由于超出字符串限制,在执行 FFmpeg 命令时出现命令提示符问题。(Windows)
- kubernetes - AKS 1.19.11 支持的 istio 版本是什么
- javascript - “classList.add”不会将类添加到 div 和表单元素
- amazon-s3 - 使用 S3Hook 获取 S3 文件的最后修改日期
- javascript - 寻找有关如何使用 Handlebars 在窗口中显示实时控制台输出的一般指针
- asp.net-core - 在我的整个 VS 2019 解决方案中更新 System.Text.Encodings.Web 的正确方法是什么?