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

Retrieve Build Log

I wanted to retrieve build log using JAVA API or Rest API.  Can some one please suggest how to get this done.

0 votes


Accepted answer

Permanent link
A later comment in the thread mentioned by Lauren shows how to get the internal ids for the build result and file contribution needed to form the URL.  But since you're starting from Java, I assume you'd prefer to get the content via the Java client API, which would avoid having to reauthenticate, etc.

For log files (and other contributions with associated file content in the RTC repository), you can use:
com.ibm.team.build.common.model.IBuildResultContribution.getExtendedContributionData()
to get the content descriptor (an IContent).

To retrieve the contents given the IContent, use ITeamRepository.contentManager() then one of IContentManager's retrieve methods:
  • com.ibm.team.repository.client.IContentManager.retrieveContent(IContent, OutputStream, IProgressMonitor)
  • com.ibm.team.repository.client.IContentManager.retrieveContentStream(IContent, String, LineDelimiter, IProgressMonitor)
  • com.ibm.team.repository.client.IContentManager.retrieveContentStream(IContent, IProgressMonitor)

Praveen Kumar selected this answer as the correct answer

0 votes

Comments

 Thanks Egar

Sorry to spell you incorrectly.  Thanks Edgar.


2 other answers

Permanent link
Hi,
I found this forum post that should get you started:  https://jazz.net/forum/questions/57724/fetch-build-log-from-an-ibuildresult-object

0 votes

Comments

Yes the post mentioned has helped us to retrieve the log file name.  But using the log file name how do I get to the log file content.  As the post said, a typical log file URL is like this.... 



Permanent link
There's also the logRetriever Ant task (since 4.0), but it requires an exact file name to match.  It would be better if we generalized this to support pattern matching.  I have filed: Allow logRetriever and artifactFileRetriever Ant tasks to match against a file name pattern (272733)

0 votes

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,939

Question asked: Jun 17 '13, 4:35 a.m.

Question was seen: 5,047 times

Last updated: Jul 18 '13, 4:49 a.m.

Confirmation Cancel Confirm