问题
I need to retrieve a build attachment attached using (##vso[task.addattachment]value) from release summary page (ms.vss-releaseManagement-web.release-details-summary-tab). Please point me to any references to achieve this.
Thanks in advance.
回答1:
Yes, you need to do followings things to get this:
1.Get the related build id of the release via getConfiguration():
var c = VSS.getConfiguration();
c.onReleaseChanged(function (release) {
release.artifacts.forEach(function (art) {
var buildid = art.definitionReference.version.id;
});
});
2.Use the build ID you get in previous step to get the detailed build information via getBuild(). And then you can get the planid from the build information.
3.Use the planid to get the uploaded file via getPlanAttachments().
来源:https://stackoverflow.com/questions/39351807/how-to-retrieve-build-attachment-from-vsts-release-summary-tab