RTC Plain Java API - Find BuildResult id based on ChangeSet id or WorkItem id
I'm using the RTC's Plain Java API.
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered May 05 '17, 2:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
That is likely not trivial.
You could look into the Locate Change Set (Search>Jazz Source control) implementation in the RTC Eclipse Client using the SDK, to try to find out how it could be done.
The Included in builds is just another link type. See https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ for the link API. https://rsjazz.wordpress.com/2017/03/29/the-work-item-command-line-is-now-open-source/ also has examples for how to use link aPI. Annie Steenson selected this answer as the correct answer
Comments
Annie Steenson
commented May 09 '17, 5:57 a.m.
Hi Ralph,
// get all references from the work item workingcopy IWorkItemReferences references = workingCopy.getReferences(); Please look into the last link I posted in my answer, download and look at the code.
If you have additional needs for that API, look into the links at the end of the blog post.
The key here is IBuildResultContribution
Ralph Schoon
commented May 09 '17, 6:46 a.m.
| edited May 09 '17, 6:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please note that the IBuildResultContributions only contain URLs that are stored in the build result. The work items and change sets that you see in the build result editor for a build result of public builds are calculated using the SCM snapshot/baseline. |
One other answer
Just to record solution for getting work item from buildResult use WorkItemHelper static method getFixedInBuild.
IWorkItemHandle[] workItemHandles = WorkItemHelper.getFixedInBuild(teamRepository, buildResult, monitor);
|
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.