I am using the azure devops rest api to extract a list of builds as follows
https://dev.azure.com/D{my Org}/{my project}/_apis/build/builds?api-version=5.1
this returns all the builds in the JSON extract correctly but only builds that have been automatically initiated by a merge to master include the build message details , included inside the trigger.info attribute of the json file.
builds that are manually fired do not have any trigger info at all
Example - see screen shot of 2 builds one fired automatically one manually
#sql-data-warehouse-20240229.3 • Merged PR 1082: FF-654: modified email body (automatically triggered)
Auto triggered creates results with a ci.message part included in the "triggerinfo" attribute in the json body
"triggerInfo": {
"ci.sourceBranch": "refs/heads/master",
"ci.sourceSha": "4040759cee517f35abf2bf1b107e033e7c33bc93",
**"ci.message": "Merged PR 1082: FF-654: modified email body",**
"ci.triggerRepository": "d5b5f4d1-49b9-4457-b934-6dffc6932ce7"
},
"id": 5545,
"buildNumber": "sql-data-warehouse-20240229.3",
manually triggered
#sql-data-warehouse-20240229.2 • Merged PR 1073: FF-654: scripts for dqm alert when fx traded (manually triggered)
"triggerInfo": {},
"id": 5537,
"buildNumber": "sql-data-warehouse-20240229.2",
Json does not return anything in the "triggerinfo" attribute
What I am trying to do is extract a list of all builds including the message note created at build time for all builds.
I have tried a variety of API options and cannot locate the information I am after
This is the expected behavior, not all builds have
ci.message.triggerInfois the sourceprovider-specific information about what triggered the build. Thereasonthat build is triggered is different, and the correspondingtriggerInfois also different.You can refer to the following examples.