It's all about the answers!

Ask a question

link between a snapshot and a build result

Vincent LE SQUERE (111) | asked Feb 09 '11, 8:32 a.m.
retagged Aug 14 '13, 12:56 p.m. by Te-Hsin Shih (2854)

i would like to know if it's possible to programmatically create a link between a build result and a snaphshot in RTC. In order to access the SNAPSHOT from the build result in the dashboard.

Furthermore, if i understand the documentation correctly, a build result can be created by building my app via the RTC build engine. Is it the only one way to create it ?
Is it possible to programmatically create a build result, no matter if it's through Java or REST API.



Todd Strangio commented Jul 16 '13, 11:44 a.m.

Also wondering the same... 

2 answers

permanent link
Tim Mok (6.6k38) | answered Jul 17 '13, 10:57 a.m.
I'm not on the build team so I'm not 100% sure but the javadoc that goes with the plain java client libraries seems to indicate that this is possible.

You can look at the LinkPublisherTask that can publish a link in your build result. You can use this to link to various artifacts, including a snapshot.

It also looks like you can create a build result. I'm guessing that if you do this, you'll have to control the entire flow of states that the build goes through (somebody correct me if I'm wrong). You should take a look at ITeamBuildRequestClient to get started requesting a build. If you have any specific questions on its usage, open up a new question.

permanent link
Nick Edgar (6.5k711) | answered Jul 17 '13, 11:12 a.m.
edited Jul 17 '13, 11:15 a.m.
Wow, sorry the original question went unanswered for so long.  Yes it's possible to do via Java API, both creating a build result and associating a snapshot.  For some examples of using the API, see

It's also possible to do via the Ant tasks, i.e. the startTeamBuild, teamAccept tasks (the latter does the SCM accept then creates a snapshot, which may be more than you want).  Using the linkPublisher Ant task that Tim mentioned is another option, but note that the snapshot will appear as an external link then, which is not the way a snapshot contribution is normally represented.

Before getting into API specifics, it would help to know more about your scenario, in case we can recommend another solution.

Todd Strangio commented Jul 18 '13, 2:48 p.m.

Hi Nick.  We're looking to duplicate a build result from buildA to buildB, a process which we plan to use after promoting from one stream to another as part of a proposed continuous integration model.  I have logic to move the build result working, but ideally we'd like to duplicate it under buildB.  Currently I've created a build result, marked it complete, and set all the set-able properties based on values from the build result as it exists in buildA.  However, I'm having trouble associating a snapshot/baseline with the result.

Apologies to Vincent for hijacking his thread - I can open a new question if you prefer.

Todd Strangio commented Jul 22 '13, 1:57 p.m.

Any insight as to why this doesn't work?  The log array is populated as expected....buildResultWC is a working copy of a build result.

IBuildResultContribution[] logs = repo.getTeamBuildClient().getBuildResultContributions((IBuildResultHandle)brToCopy.getIBuildResult().getItemHandle(), IBuildResultContribution.LOG_EXTENDED_CONTRIBUTION_ID, repo.getMonitor());
repo.getTeamBuildClient().addBuildResultContributions((IBuildResultHandle) buildResultWC.getItemHandle(), logs, repo.getMonitor());

Error is:
Save Build Result
Unable to login: !ContentStorage.attributeDoesNotMatch! 

Your answer

Register or 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.