1

I would like to have a gate which requires at least one work item of the 'Release' type associated with the pipeline. Is there a way to have the gate query execute SELECT [System.Id] FROM WorkItems WHERE [System.WorkItemType] = 'Release' AND [Com.Pipeline] = "$(Release.DefinitionName)" (or equivalent)?

I need it to work through multiple pipelines, which is why I would like to use on of the built-in variables to avoid creating a hundred separate queries. If not possible, is there a better way to stop deployment from moving to the next stage if there isn't a specific associated work item?

1

So ended up reading about the WIQL API calls, and used an 'Invoke Web Request' task to execute the above query, with the success criteria being root['workItems'][0], which errors out if there isn't an element present. Not quite as elegant as the Query task I was shooting for, but it serves its purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.