0
votes

I'm currently trying to do some magic using the VSTS api, but something is a little bit surprising me.

Using the method described here: https://docs.microsoft.com/en-us/rest/api/vsts/build/definitions/get?view=vsts-rest-4.1, I made a call an receive my response.

Despite the documentation, I'm not able to read the revision counter, who is simply missing from the response. That's my goal, overwrite this counter using an homemade powershell...

Is there something I shoud know about the VSTS api, like an admin restriction or something else?

Did someone met the current issue?

1
You can't change the revision counter. Why do you want to?Daniel Mann
Because I'm redefining the build number using powershell, to get a MajorVersion and MinorVersion from a json available in $(build.sourcesDirectory).As side effect, it reset the revision number, so I'm trying to handle it by myself.Nico
The build definition's revision counter has nothing to do with a build's build number. I don't understand what you're trying to accomplish.Daniel Mann
I dont want the build def revision number, I want to get the "build process revision". You can define a build with n modifications, and execute it z time. Build number is gonna be formatted like this: $(MajorVersion).$(MinorVersion).$(z) . I want to get and update $(z) by myself.Nico
$[ counter('name', seed) ] as the expression value seems not to be working...Nico

1 Answers

0
votes

To get the build definition's revision counter, you should use the REST API Get definition revisions:

GET https://{accountName}.visualstudio.com/{project}/_apis/build/definitions/{definitionId}/revisions?api-version=4.1

Then you can get all the revisions ids and counts.