It's all about the answers!

Ask a question

Need C# code or API for integrating Rational team concert work items


Mohamed kalith (1122) | asked Mar 02 '16, 11:09 p.m.
 Hi All,

I need a from you, I want to integrate Rational Team concert defects with c#.net. Please refer me any of code or c# API on this. I am searching this for last one week but still i could not find anything code or API on this, Kindly help me on this.

Thanks in Advance
Mohamed Kalith

4 answers



permanent link
sam detweiler (12.5k6195201) | answered Mar 02 '16, 11:22 p.m.
edited Mar 03 '16, 7:36 a.m.
someone posted a link to the source for logon the other day. I downloaded it an looked it over.. looks reasonable and matches what I would do from a commandline.

there is no C# api, so you will have to use the OSLC REST apis. I don't know how to do this from C#.
not my language.

here is the OSLC workshop link
https://jazz.net/library/article/635

here is my little curl script to get a workitem
set COOKIES=.\cookies.txt

set USER=uuuu
set PASSWORD=pppppp
set HOST=https://server:port

rem set the session cookie
curl -k -c %cookies% "%host%/jts/authenticated/identity" >nul

rem logon using the session cookie
curl -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PASSWORD% %host%/jts/authenticated/j_security_check >nul

rem get the catalog
curl -k -L -b %COOKIES% -H "Accept: application/xml" %host%/ccm/oslc/workitems/catalog

rem get the a list of workitem services.. the context value needs to be set properly
curl -k -L -b %COOKIES% -H "Accept: application/xml" %host%/ccm/oslc/contexts/_GYeCsFT4EeKDJbr7x3deog/workitems/services.xml

rem get the a list of workitems.. the context value needs to be set properly
curl -k -L -b %COOKIES% -H "Accept: application/xml" %host%/ccm/oslc/contexts/_GYeCsFT4EeKDJbr7x3deog/workitems

rem get the specific fields for workitems
set o="curl -k -L -b %COOKIES% %host%/ccm/rpt/repository/workitem?fields=workitem/workItem/itemHistory\[modifiedBy/name='sam'\]/(stateId|predecessor|state/name|modified|modifiedBy/name|modified)"
echo %o%



permanent link
Mohamed kalith (1122) | answered Mar 02 '16, 11:31 p.m.
 Thank you sam detweiler, But I saw this code already , I am looking for exact code for this. else any body kindly help me on this

Thanks in advance


permanent link
Devlon Infotech (11) | answered Mar 03 '16, 12:55 a.m.
edited Mar 03 '16, 1:01 a.m.

hello

You are not required to authenticate against API in order to access it. From this document you can then retrieve all qualified names if you don't already know them.

Once you know the Name that points to the document you're looking for, you can then instruct your parser to look for that element and extract the resource URI to discover. Typically, any subsequent request from this point onward will require you to be authenticated against the RTC server.

In this forum we have used the Service Providers catalog document as an example, but from the root services document you may access any resource that RTC exposes through its APIs.

Try sending a request to the rootservices document in your browser then examine the response you get and see if the document you're interested in is there. Hope this helps. Ileana

Thanks 

Comments
sam detweiler commented Mar 03 '16, 7:42 a.m.

there is not much you can access without authentication..

to get the workitem catalog requires authentication..
HTTP/1.1 302 Found
X-Powered-By: Servlet/3.0
X-com-ibm-team-repository-web-auth-msg: authrequired

here is a good article on discovery and navigating from the rootservices document.
https://jazz.net/library/article/1001


Ralph Schoon commented Mar 03 '16, 10:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In general there are a lot of posts around REST that you can find on the internet: See http://rest.elkstein.org/2008/02/using-rest-in-c-sharp.html for example.


permanent link
Mohamed kalith (1122) | answered Mar 09 '16, 1:24 a.m.
 Hi All,

Else anybody having c# api or code for Rational team concert to consume defect and other work item details?

Please share your code or idetas,

Thanks,
Mohamed Kalith

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.