Welcome to the Jazz Community Forum
Need C# code or API for integrating Rational team concert work items

4 answers

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%

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
ThanksComments

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

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.