Retrieve work items from RTC using C# code
Can anyone help to provide a sample C# code for retrieving list of project which are created at RTC and its associated work item through REST API using C# code.
Thanks
|
Accepted answer
If you're really "new", I suggest you learn how to use C# to access REST API first.
Ralph Schoon selected this answer as the correct answer
Comments Thanks Ralph and Donald:-)
I guess the question was wrongly understood...the thing is, i am trying to get project name and its associated items by using the below.....but getting 403 forbidden error. so it would be better to provide the right URI will help me
string _serverURL = https://localhost:9443/ccm; string _resourceURL = "https://localhost:9443/ccm/rootservices"; _resourceURL + "/oslc/contexts/_0_iN4G09EeGGMqpyZT5XdQ/workitems/order"
CookieContainer _cookies = new CookieContainer();//create cookie container HttpWebRequest documentGet = (HttpWebRequest)WebRequest.Create(_resourceURL); documentGet.Method = "GET"; //method documentGet.CookieContainer = _cookies; //set container for HttpWebRequest documentGet.Accept = mediatype; documentGet.Headers.Set("OSLC-Core-Version", "3.0"); //for RTC 3.0.1.2 documentGet.Timeout = 300000; HttpWebResponse response = requestSecureDocument(documentGet, _serverURL, username, password);
Donald Nong
commented Oct 16 '17, 2:11 a.m.
Your _resourceURL variable contains an incorrect URL. Also, header "OSLC-Core-Version: 3.0" won't get you anywhere, as the current implemented OSLC version is 2.0.
|
One other answer
Ralph Schoon (63.5k●3●36●46)
| answered Oct 12 '17, 3:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I am not a C# guy, but I know our developers for the VisualStudio integration use HTTPS/REST calls. This question has also come up several times already.
Try the result of https://www.google.com/search?q=get+work+item+C%23+site%3Ajazz.net
Comments
might be. but i am new to this area, so better to share some C# code examples or links to understand better.
Thanks Ralph for your reply:-)
If you are new to this, you should better read the results of the google query.
I have nothing to share. My examples are all Java, but if you are interested, you can find them here: https://rsjazz.wordpress.com
they won't help you of course.
|
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.