I need to retrieve build task name list from VSTS/TFS build. Is there inbuilt method/library available to support this?
I have already noted (as below sample) that we can retrieve same in release.
import ReleaseClient = require("ReleaseManagement/Core/RestClient");
var rc= ReleaseClient.getClient();
release.environments.forEach(function (env) {
rc.getTasks(VSS.getWebContext().project.id, release.id, env.id).then(function(taskList){
...............
......Some code here
});
}
The documentation doesn't show a direct function call to retrieve the tasks. However, there is a contract for a
BuildDefinition
, which contains abuild
property, which is an array ofBuildDefinitionStep
, each of which has atask
property that contains things like the name of the task and the inputs.The
getDefinition()
function should give you back a build definition you can work with.