WorkItemUpdater
WorkItemUpdater copied to clipboard
No Workitem found in a release with multiple artifacts
I have a release pipeline with 5 artifacts coming from 5 different pipeline.
in that case the value coming from Build.BuildId cannot be trusted because it gave you only one (first one in the array for what I can tell).
by using the allWorkItemsSinceLastRelease it tries to retreive all workitem with the getReleaseWorkItemsRefs, but i don't know why it seems to never retreive anything
i managed to get a list of workitems by tempering in the js of the activity and using the artifact list.
const releaseClient = yield vstsWebApi.getReleaseApi();
var currentRelease = yield releaseClient.getRelease(settings.projectId, settings.releaseId);
tl.debug(currentRelease.name);
tl.debug(currentRelease.artifacts.length);
for (let artifacts of currentRelease.artifacts)
{
tl.debug(`Looking at artifact [${artifacts.alias}]`);
tl.debug(`Build Number ID [${artifacts.definitionReference.version.id}]`);
var releaseWorkItemRefs = yield buildClient.getBuildWorkItemsRefs(settings.projectId, [parseInt(artifacts.definitionReference.version.id)]);
releaseWorkItemRefs.forEach((releaseWorkItem) => {
tl.debug('push :' + releaseWorkItem.id);
result.push({id: releaseWorkItem.id.toString(),
url: releaseWorkItem.url
});
});
}
return result;
This could indeed solve the issue. Not sure how to get that to work though when also enabling the "Include workitems since previously completed deployment" checkbox. I need to dig some deeper into that before I can make a change.
Any update / current work around for this issue?
Hi, any update on this?
I also would need this feature since basically all our pipelines release multiple atifacts at once. I know some other extensions are using the artifact difference to last release like this one: https://github.com/rfennell/AzurePipelines/tree/main/Extensions/GenerateReleaseNotes
It works in my first couple releases. Had to add some additional cases and to properly reflect the tasks settings. Now it updates all links from artifact builds used if no prior release exists or if the allWorkItemsSinceLastRelease setting isn't used.
If anyone wants to try please see my fork or send me a message so I can share my privat Market Place Extension with your organization.
Thanks for the contribution!