I have a repo name called A
with its build pipeline as azure-pipelines.yml
Then I have another repo called B
with its build pipeline as
After a lot of struggle and the help of wise people here I finally manage to tame the issue. I'm posting here so that anyone can take a referebce. This is working now refer: ListBuild and QueueTheBuild
name="ProjectA"
curl --silent -X GET -H "Authorization:Bearer $(System.AccessToken)" -H "Content-Type:application/json" $(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_apis/build/definitions?api-version=6.0 --output /tmp/response.json
#Now get the build-id of your project you are interested in
#please be aware that api-version > 6 has different json output and below command
#may not help you to give the right id
id=$(cat /tmp/response.json | jq -r --arg key ${name} '.value[] | select(.name==$key)| .id' --raw-output)
#create your body to post
generate_post_data()
{
cat <