How to get the ITeamBuildService
Accepted answer
Comments
Sam, thanks so much for sharing!
I will try to blog about this, so others can use it too.
my pleasure..
That is used in my code snippet. I will try to find out how it works.
yes, your snippet is using BuildDefinitions not BuildEngines.
2 other answers
I would assume you have to use the ITeamBuildClient.
Comments
Thanks for your information Ralph. My requirement is to get all the build definitions. I find ITeamBuildService has the getBuildDefinitions() function. So I asked how to get ITeamBuildService object. Or if you know any other method to get all the build definitions, it is useful for me. Thanks !
please have a look into the JavaDoc of the Plain Java client library and try to use the basic search functionality in the Eclipse PDE with Eclipse set up for SDK and Plain Java development (see my article on how to).
I could find a method to get the build definitions from the ITeamBuildClient in less than 3 minutes. This is a client library that you cen get using getClientLibrary().
Comments
Ok, you are better than me. I cannot find a method to get the list of build engines or builds.
No, I am not. 8-)
Does https://jazz.net/forum/questions/123863/how-to-get-build-engine-of-a-build-definition-by-java-api answer your questions?
I dug a bit deeper. I was also not able to instantiate the ITeamBuildService. The implementation of TeamBuildClient implements a getService() method that is private and does not appear in ITeamBuildClient to get the ITeamBuildService.
private ITeamBuildService getService() { return (ITeamBuildService) getContext().getServiceInterface(ITeamBuildService.class); }
I think Jia did what you attempt as well, maybe she has a better answer. Otherwise I would suggest to use the https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples to get at the data you need and then try to dig deeper.
yes, I saw that in the buildclient code. Your prior note link shows how to get build engines for a build def. nice, but then I need all buid defs.. :-)
i need to copy everything. build engines are supposedly the top of the tree.
Sam, i have not the time today to poke through the API. You might be able to find query examples and be able to query for what you are looking at. Jia might be able to provide some hints.
I do not expect u to spend time to research solutions for me.
thanks for the pointers..
there is a ton of pressure to get this project moved from their old 3.0.1 system to the production landscape on 4.0.4. like week before last.. I've got everything but builds, and my coworker is building the links reconstruction tool and he is close as well.
I think in my answer I refered to
ITeamBuildClient teamBuildClient = (ITeamBuildClient) teamRepository.getClientLibrary(ITeamBuildClient.class); teamBuildClient.getBuildDefinition(buildDefinitionId, monitor);
Unfortunately, this does only provide you with what you want, if you know the ID already.