Reportable REST API versus Plain Java Client API for accessing Work Item queries and Work Item attributes
BACKGROUND:
I need to either run queries defined in our project or run a query that I define via one of the RTC APIs. The goal is to return two custom attributes that are saved with the work items based on a few key fields like State and Planned For.
QUESTION 1 – run an existing query?
I see that it is possible to use the Java Client API to execute a query that is already saved with the project (http://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/). Is anything like this possible using the REST API?
QUESTION 2 – why use one API over the other?
Regardless of that, is there a clear advantage to using the REST API or the Plain Java Client API in terms of simplicity, maintainability, etc.? Why would I want to use one over the other?
Our client wants us to minimize customization and coding as much as possible. I assume the Plain Java Client API is more powerful and allows more features and customized control but that it may come with more overhead in terms of complexity and maintenance. Thanks in advance!
3 answers
from an OSLC / REST API perspective:
- you can execute a predefined query using OSLC.
Please refer to https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries
- for the difference between OSLC and RTC REST APIs, a good entry point is here:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#OSLC
Regards,
Stéphane
Comments
| see correct answer below.
how to construct am OSLC workitem query https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Query_Capabilities
OSLC is a set of common primitives across many platforms. thus even the concept of a predefined query might not be accurate.
note that you are developing a fairly complex application in either case. Finding and training subsequent support teams will be the issue. Combining some scripting language, HTTP, cookies, javascript and JSON together seems a harder match of resources than find a java programmer.
and there are some things you just cannot do with OSLC today, (or maybe ever) that you CAN do with the Java apis.
Sam
Lyo provides Perl and Excel sample implementation. I have another Perl implementation to query RTC workitems. It looks like this.
my ($result_count, $result_set) = QueryWorkItems($ua,
$query_service, $oslc_where, $oslc_select, $oslc_search, $oslc_orderBy);
For example, it runs like this.
$ perl query-workitems.pl
dcterms:identifier,dcterms:title,oslc_cm:status,
3,Define a new build,Completed,
2,Define the initial Product Backlog,Completed,
1,Define Phase Plan,Completed,
Comments
Michael Taylor
Jun 19 '13, 3:17 p.m.