Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Fetching snapshot from BuildResult

 In RTC client someone could download the snapshot generated by the Build in the BuildResult page (there is a link to lead you to the snapshot).


I checked the IBuildResult class but couldn't find out any API associated with the snapshot.  Could someone show me the API to be used to fetch the snapshot created by specific Build?

Thanks

0 votes


Accepted answer

Permanent link

Here is how you retrieve the snapshot (IBaselineSetHandle) associated with a build result using the client-side Java API. (Note: I am assuming you already know the code used to fetch the full IBaselineSet from the IBaselineSetHandle):

   ...
   IBuildResultHandle buildResultHandle = getBuildResultHandle(); // This can be 'any' build result or 'release'
   IBaselineSetHandle snapshotHandle = null;
   ITeamBuildClient client = (ITeamBuildClient) getRepository().getClientLibrary(ITeamBuildClient.class);
   IBuildResultContribution[] contribution = client.getBuildResultContributions(buildResultHandle ,
      new String[] { ScmConstants.EXTENDED_DATA_TYPE_ID_BUILD_SNAPSHOT }, monitor);

   if (contribution.length > 0) { // It's possible for a build to NOT have a snapshot contribution
      snapshotHandle = (IBaselineSetHandle) contribution[0].getExtendedContribution();
   }
   ...

Ralph Schoon selected this answer as the correct answer

0 votes


2 other answers

Permanent link
 It is very unclear what you are trying to do here is a hint on the API, however https://jazz.net/library/article/807  Robins blog also mentions some interesting insight into the API http://ryehle.wordpress.com/ .

0 votes

Comments

 Thanks Ralph,  I have reviewed https://jazz.net/library/article/807  but couldn't find any luck.


As far as I know when the build is complete a snapshot will be generated automatically and link to the build.

If someone search the build in RTC client, they can find the link to get this snapshot in the Overview tab -> Contribution Summary section.

I would like to find out the logic (api) how to fetch this snapshot associated with the specific build.

Hope that clarifies. 

Thanks.


Permanent link
I would like to reactivate this question:

Is there any opportunity to fetch a snapshot from a release via java plain api?

0 votes

Comments

It does not make sense to "reactivate" a 6 years old question. Anyway, if the release was created from a build you can open the build result from the release in the Eclipse client and from the build result you can get at the snapshot, It is available in the Eclipse client, so the likelihood to be able to do this using the plain java API is pretty high. It might use internal API. I have no example code.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 562
× 169
× 74

Question asked: Dec 19 '12, 4:11 p.m.

Question was seen: 7,421 times

Last updated: Mar 29 '18, 2:17 a.m.

Confirmation Cancel Confirm