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
Hi Michael,
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
Michael Taylor
commented Jun 20 '13, 10:30 a.m.
Thanks. The 2nd link helped shed some light on the differences between RSLC and Reportable REST API. Is it possible to execute a predefined query using the Reportable REST API syntax or does it have to be the OSLC syntax? Am I understanding correctly that the OSLC syntzx has to be multi-line (passed via some sort of program or script) whereas the Reportable REST API can be passed single line from a web browser? Also, I am not familiar with some of the syntax such as "_iTY_8EqVEd6HXO10niqZpg" in the following: Is that generated? Where does that come from and what does it mean?
<dc:creator rdf:resource="https://localhost:9443/jazz/oslc/users/_iTY_8EqVEd6HXO10niqZpg"/>
Hi Michael,
|
I think you can construct a query using OSLC, I do not think you can execute a predefined query using OSLC.
| 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 Comments
Michael Taylor
commented Jun 19 '13, 6:03 p.m.
Thanks for the wiki link. I see that link is for RTC 2.0. Is there a link for RTC 4.x? Also, how does OSLC relate to the RTC Reportable REST APIs (https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#workItem_type_com_ibm_team_worki)? Is it the same thing? |
I also suggest to take a look at Eclipse Lyo project too. The preference of REST or Java depends on situation. REST is useful when customer is working on another WEB application. Java is more for automation (e.g. command line). It is possible to create command line interface using REST interface too.
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,
Comments
Michael Taylor
commented Jun 20 '13, 10:34 a.m.
Thanks for the information and examples. I assume you are talking about Lyo at http://www.eclipse.org/lyo/. Does Lyo provide some sort of GUI or interface that makes using Reportable REST APIs or OSLC easier to use? Or would its benefit be more for examples of how to use Reportable REST APIs or OSLC to run predefined queries or to construct and run new work item queries? Lyo does not provide GUI except Excel I/F where Excel itself provide GUI).
|
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.
Comments
From other posts I've read on jazz.net and rsjazz.wordpress.com, it seems that Ralph Schoon is an expert on the plain Java APIs. I'd appriate it if Ralph could answer.
I'd also appreciate thoughts from a REST API expert as well. Thank you.