Access Build Information from OSLC
I want to access information regarding the workitems associated with a build from OSLC. I have found the information at this web page : https://jazz.net/wiki/bin/view/Main/RTCAutomationOSLCPrototype which looks helpful but I cannot browse through the OSLC structure to find the starting point for getting this, nor does it work when I paste in an OSLC identifier for the project area into the URL shown below:
If I replace the template below with information about my server then I get a not found error : URL pattern is:https://someServer:port/jazz/oslc/contexts/{projectAreaId}/automation/services I have taken the projectAreaId from the information reported by the Work item catalog link here : /ccm/oslc/workitems/catalog which returns : oslc_disc:details rdf:resource="https://myserver:9443/ccm/process/project-areas/_i777YPCqEd-i17guFPVVOw" So for the {projetAreaId} I used _i777YPCqEd-i17guFPVVOw from the above. Can someone please guide me to the OSLC access to the build information starting from the top of the OSLC heirarchy. Ultimately the customers requirement is to advance a work item through the state lifecycle when it has been associated with a successful build. If anyone has experience of doing that with OSLC then please shout. |
5 answers
The <repo>/rootservices resource does not point to the automation support because the OSLC Automation implementation in RTC 3.0 is only a prototype. Also note that the spec isn't finalized, so there may be further changes in the API, some of which may be breaking API changes.
To get the catalog for automation services, use e.g.: https://jazz.net/jazz/oslc/automation/catalog This yields, e.g.: ... Following the services link: https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/services.xml yields: ... The plan query link: https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/plans yields all plans (i.e. build definitions): ... The use of olsc_cm:collref for the results query is a bug. It should be rdf:resource. Following that link yields the results: ... Following the contributions link yields the various contributions to the build (logs, downloads, links, etc): ... Unfortunately, there's no way, currently, to determine the work items associated with changes in the build via the OSLC Automation API. The links given are only the links explicitly published as link contributions, not the work item links generated as a side effect of accepting changes. The only other approach I can see is to use the internal REST interface that supports our web UI. For example, try: https://jazz.net/jazz/resource/virtual/build/definitions?_prettyPrint=true https://jazz.net/jazz/resource/virtual/build/definition/_AHLqcIkAEd6RvINWj6hoDw?_prettyPrint=true https://jazz.net/jazz/resource/virtual/build/results?definition=rtc.jcb&_prettyPrint=true https://jazz.net/jazz/resource/virtual/build/resultpresentation/_vp1C4AdqEeCmSNb08EOl6Q?_mediaType=text/json&_prettyPrint=true These yield JSON, not XML. The _mediaType and _prettyPrint query args are just for debugging. The result for the last link includes: ... There would be one such contribution for every included work item. Hope this helps. Note that the internal REST interface is internal, so it may too may change at any time. It's been pretty stable since 2.0 though. |
I filed work item https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/148411 to track oslc_cm:collref issue
|
Nick,
Thanks very much for the information on the build records from OSLC. You mention that the list of work items associated with the build as a result of being accepted into the workspace is not available in the build. should that information appear within the 'Contributors' data in the area of : <oslc_auto> <oslc_auto> <dc> <rdf>rtc_build:BuildResultContribution</rdf> <rtc_build> </oslc_auto> The contributionType of 'Fixed work items' does look like a good candidate to have this information in the future since the link above doesn't really give me a great deal at the present. |
Mike, re your question about any updates, there have been no changes since then in our OSLC Automation implementation. You may want to track a related plan item: [CCM] Implement OSLC Automation v2 spec (237822)
Comments You can use the generateChangeLog Ant task, which can list the change sets and associated work items in a particular build (as well as between two specific builds or snapshots). See the doc for it in the RTC Eclipse client help. You'd still need to list builds using OSLC Automation. Another possibility is to do it all using the Java client API, or a scripting layer on top of that, e.g. I've used JRuby in the past to do this kind of thing. Mike, were you able to get it going using the fixed query in #274594? Nm, I see that you did. Good to hear. |
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.