It's all about the answers!

Ask a question

Reportable REST API versus Plain Java Client API for accessing Work Item queries and Work Item attributes


0
1
Michael Taylor (8865764) | asked Jun 19 '13, 11:20 a.m.

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!


Comments
Michael Taylor commented Jun 19 '13, 3:17 p.m.

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.

3 answers



permanent link
sam detweiler (12.5k6195201) | answered Jun 19 '13, 5:17 p.m.
edited Jun 20 '13, 8:14 a.m.
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?


permanent link
Stephane Leroy (1.4k149) | answered Jun 20 '13, 5:00 a.m.
JAZZ DEVELOPER
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"/>;


Stephane Leroy commented Jun 25 '13, 2:16 p.m.
JAZZ DEVELOPER

Hi Michael,

contrarily to what I stated previously you could not execute a query using OSLC. 
At least not using OSLC v2.0 (i.e. with the header OSLC-Core-Version set to the 2.0 value in your GET header). The alternate way I'm aware of is to build a query (directly in the URL - note that these are not the predefined queries you created before in the UI or the Eclipse client)  by filtering on specific attributes, etc on top of base query URL. For a reference on this: check http://open-services.net/bin/view/Main/OslcCoreSpecification#Query_Capabilities

My initial answer was based on the information returned using OSLC-Core-Version 1.0. See a more detailed answer I gave you here: https://jazz.net/forum/questions/117492/execute-queries-created-in-the-rtc-query-editor-via-reportable-rest-api

Sorry for the convenience if my guidance was (temporarily) misleading.
Note: I shall make sure the wiki topic https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries is updated with clarifications.

Regards,
Stéphane


permanent link
Takehiko Amano (1.3k3741) | answered Jun 20 '13, 5:23 a.m.
JAZZ DEVELOPER
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,
3,Define a new build,Completed,
2,Define the initial Product Backlog,Completed,

1,Define Phase Plan,Completed,
 



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?


Takehiko Amano commented Jun 20 '13, 9:32 p.m.
JAZZ DEVELOPER

Lyo does not provide GUI except Excel I/F where Excel itself provide GUI).

Some example implementation of OSLC GUI is FireFox add-on:

http://www.ibm.com/developerworks/rational/library/firefox-add-on-oslc-servers/index.html

Just for reporting purpose using existing query, it may be easier just run BIRT report.


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.