WorkItemUpdater icon indicating copy to clipboard operation
WorkItemUpdater copied to clipboard

No Workitem found in a release with multiple artifacts

Open TinySam opened this issue 4 years ago • 3 comments

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;

TinySam avatar Mar 11 '20 17:03 TinySam

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.

BlueBasher avatar Jul 09 '20 05:07 BlueBasher

Any update / current work around for this issue?

rschoenbach avatar Nov 29 '21 22:11 rschoenbach

Hi, any update on this?

atiffarrukh avatar Jan 18 '24 05:01 atiffarrukh

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

lktraser avatar Jul 26 '24 13:07 lktraser

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.

lktraser avatar Aug 08 '24 14:08 lktraser

Thanks for the contribution!

BlueBasher avatar Aug 08 '24 17:08 BlueBasher