It's all about the answers!

Ask a question

Accessing RTC Work Items Programatically


0
1
Gregory Hatt (1213) | asked Sep 22 '15, 12:49 p.m.
edited Sep 22 '15, 12:50 p.m.
I am fairly new to RTC and am looking for a way to both query and update work items via the REST API :
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2 . I can access the root services document at .../jazz/rootservices but it does not contain the element:

<oslc_cm:cmServiceProviders rdf:resource="https://localhost:9443/jazz/oslc/workitems/catalog"/>

I'm wondering if an admin has to enable the REST API so I can programmatically query the work items? For example, I just want to get a JSON representation of a single work item.

Additionally:

My end goal is to create a web service that will call on the API to update work items which will be hit by a form; at this point I'm just trying to hit the API and am struggling to get traction. If anyone has any suggestions or useful links, I would be grateful.

Comments
Donald Nong commented Sep 22 '15, 8:12 p.m.

What is <dc:title> in the received document? Can you post the response content? If you compare what you have got to https://jazz.net/jazz/rootservices, what differences do you notice?


1
Gregory Hatt commented Sep 23 '15, 8:28 a.m. | edited Sep 23 '15, 8:41 a.m.

Hey Donald,

The URL I'm using is to access the document:
https://sma-unleash.ratl.swg.usma.ibm.com:9445/jazz/rootservices

I notice that it doesn't have:

<oslc_cm:cmServiceProviders rdf:resource>;
Maybe I'm just confused about the URL I need to access the API of this particular Jazz server, in other words maybe I need to be using a different URL than https://sma-unleash.ratl.swg.usma.ibm.com:9445 .

Fairly new to RTC, any clarification would be great!

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Sep 23 '15, 8:29 p.m.
edited Sep 23 '15, 8:30 p.m.
The server that you are using has a non-standard configuration. The URL that you used points to JTS, not CCM/RTC. If you check the /jazz/rootservices document, you will see that <dc:title> is "Rational Jazz Team Server". If you then follow the /jazz/application-about link, you will also see that the version is 5.0.2

For this particular server, the context root for CCM/RTC is /ccm or /rtc. Both /ccm/rootservices and /rtc/rootservices return the same document, which confirms that the correct context root should be /rtc. In this document, you will see the tag that you are looking for, and also notice that <dc:title> is "Change and Configuration Management".

In summary, the starting point for your exercise is https://sma-unleash.ratl.swg.usma.ibm.com:9445/rtc/rootservices
Gregory Hatt selected this answer as the correct answer

Comments
Gregory Hatt commented Sep 25 '15, 10:18 a.m. | edited Sep 25 '15, 10:19 a.m.

 Thanks so much, that is a great help. I might have one other URL question if you don't mind.

I've been trying to login using the Java API Ralph linked me too but I'm having a strange issue. Here's the code: https://bpaste.net/show/109978e4b345 . I've tried every combination to login but I always get the same exception : https://bpaste.net/show/d5c67af6c5a5 which fires on the line:  ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri); I'm wondering if it's my URL that's causing it. Also, thanks again!


Ralph Schoon commented Sep 25 '15, 10:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you want to use Plain Java start here:

Setting up Rational Team Concert for API Development
Understanding and Using the RTC Java Client API

and the related posts. the URI used to login to a RTC Server is usually https://server:port/ccm


Donald Nong commented Sep 27 '15, 7:54 p.m.

Hi Gregory,

I have only limited experience with the plain Java API. Ralph is the expert in this area.

One other answer



permanent link
Ralph Schoon (63.6k33646) | answered Sep 23 '15, 2:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Consider: Open Services for Lifecycle Collaboration Workshop and Developing an OSLC consumer to collaborate with the Requirements Management application.

I tried to collect some information on OSLC and REST here: https://rsjazz.wordpress.com/interesting-links/ even if the blog is really not about REST/OSLC yet.

Comments
Ralph Schoon commented Sep 23 '15, 3:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note: the domains could be different, but the core methods should be the same.


Gregory Hatt commented Sep 25 '15, 10:11 a.m.

Thanks Ralph, there's a wealth of information in these links. You've been a great help. 

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.