【发布时间】:2016-12-13 17:33:46
【问题描述】:
我想查询 GIT 提交以获取与特定提交关联的相关工作项 ID。 (https://www.visualstudio.com/en-us/docs/integrate/api/git/commits)
请求:
http://{server}/tfs/{collection}/{git repository}/_apis/git/repositories/{repository name}/commits?api-version=1.0
不幸的是,它返回截断的 cmets,因此并不总是可以看到工作项 ID (#{Work Item ID})。
{
"count": 100,
"value": [{
"commitId": "commit hash",
"author": {
"name": "some name",
"email": "some email",
"date": "2016-12-12T14:29:28Z"
},
"committer": {
"name": "some name",
"email": "some email",
"date": "2016-12-12T14:29:28Z"
},
"comment": "Merge branch 'someBranch' of something.",
"commentTruncated": true,
"changeCounts": {
"Add": 5,
"Edit": 34
},
"url": "url",
"remoteUrl": "remoteUrl"
}]
}
在上面的响应中,属性“commentTruncated”设置为 true。 我已阅读文档,但没有找到单独获取完整评论或相关工作项的解决方案。
【问题讨论】: