问题
I am able to successfully create a bug in VSTS using REST API via powershell. See this question for some back story.
But how do I specify it to create the bug in the current iteration ? Do I have to find out what is the current iteration prior to providing the path ? Is there no way to just directly create it in the current iteration ?
Please note that this question is about Create Work Item API, whereas the question mentioned here is about the Iteration API.
回答1:
There isn’t such feature in VSTS build, the workaround is that you can update the related work item through web hook.
- Build a api project (e.g. ASP.NET web api) to update work item per to build id (Get build’s work item through Get Build Work Items Refs rest api)
- Create a web hooks with build completed event, set Failed status in Filters
- Specify that url of your API app.
来源:https://stackoverflow.com/questions/50710446/vsts-api-create-bug-in-current-iteration