It's all about the answers!

Ask a question

Execute project query by RTC api in c#


Krzysztof Płazio (132) | asked Nov 08 '21, 8:35 a.m.

 Hi

I have a problem with get query result from my project. How can i do this?

For ex.
Result of my query:
Id        Name
--------------------
1         Josh
2         Jack
3         Thomas

I want to write it to DataTable. 

Greetings

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Nov 08 '21, 11:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am sorry, but this is by no means enough as a question to be able to answer. Please be aware of https://rsjazz.wordpress.com/2013/03/14/what-apis-are-available-for-rtc-and-what-can-you-extend/ and https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding . With C# you will most likely want to use the OSLC or the reportable REST API https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Reportable_REST_API


Krzysztof Płazio selected this answer as the correct answer

2 other answers



permanent link
Ralph Schoon (63.1k33646) | answered Nov 09 '21, 6:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I have provided you with all links you can use for self enablement I can. The links include how to run queries. In the example above use a different media type such as text/xml to get the data in the response and not as csv file.


Comments
Krzysztof Płazio commented Nov 09 '21, 6:57 a.m. | edited Nov 09 '21, 7:23 a.m.

Ok. It works :) Thank you for your answer :) Have a nice day


permanent link
Krzysztof Płazio (132) | answered Nov 09 '21, 2:35 a.m.

 Hi.

In my project i have Work Item Query, and i want to execute it and write data from my query result to DataTable in my C# program. 
For ex. my query select ID and Name from type Defect, and result of this query is:   

Id        Name
--------------------
1         Josh
2         Jack
3         Thomas

and I want to write this data to DataTable variable by REST API.  
What should I do? I found something like this:
https://<url>.<domain>/ccm/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/<queryId>?_mediaType=text/csv
It's result, which i want to get, but in *.csv file. I want to get the same result like in this csv file, but write into DataTable by API. 

Kind regards


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.