I am working on a Ymal pipeline where I'm consuming build artifact from another pipeline.I'm able to download artifact using below code:
- task: DownloadBuildArtifacts@0
inputs:
buildType:specific
project: Test Project
pipeline: TestInfrastructure-Rel
branchName: 'refs/heads/release/preview'
downloadType: 'single'
artifactName: Testartifact Packages
buildVersionToDownload: 'latest'
downloadPath: '$(System.DefaultWorkingDirectory)'
In above code I know I can set property buildId to get build id via this link https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-build-artifacts?view=azure-devops
Though I want to know what is the package version.I'm using this API to get information from the particular build but artifact version number is not coming up. https://dev.azure.com/{Org name}/{Project name}/_apis/build/builds/{buildid}/timeline/?api-version=5.1
Basically I have to create a report on daily basis based on the specific pipeline run where I will need all the information.
I also would like to inform you I have package version in the pipeline via resource though I am not able to set it in to a variable. If i set package version in any variable its not showing in the build pipeline ymal json. when I run the API using the https://dev.azure.com/{Org name}/{Project name}/_apis/build/builds/{buildid}/timeline/?api-version=5.1 I am not seeing any package version in side below task in the image. If we can set version from ymal pipeline from any property or anything so that I can get that version here in below image.
If anyone can help me or guide how I can set or pass version number using variable or any other property in PowerShell or azure PowerShell task that would be really helpful.
Thanks