Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is There a Simple Work Item Query Via REST API?

I've been looking through the docs and Googling around the web for information on a REST API for querying work items. I've found some old, seemingly outdated information, and I saw a rather complicated API with OLSC that requires multiple calls to just get to the service I need. What I'm looking for is a simple way to query work items in a Node.js app. Something like, 
GET https://<rtc_host>:<port>/services/workitems?owner=bob&open=true?foundIn=iteration3
that returns some nice JSON (though I'd settle for nasty XML) with a list of work items that meet the search criteria.

Does something like this exist? If not, can you point me toward a tutorial or some documentation for how to use the existing APIs for querying work items? 

0 votes


Accepted answer

Permanent link
Yes it can be easily done with RTC OSLC API. The query would look like this

To get the response in JSON format, simply add the HTTP Request Header "Accept: application/json".

For more details about using the OSLC API, see below articles.
https://jazz.net/library/article/1001
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Examples
Allen Boone selected this answer as the correct answer

2 votes

Comments

Thanks for the help. The approach in the first article worked, but it says that the only URI I should keep in the code is the rootservices path. Doing so requires a couple of extra REST calls that I'd like to avoid, however. Is it necessary to follow this procedure, or can I save the workitems service path? Is it likely to change? 

 Thanks for the help. The approach in the first article worked, but it says that the only URI I should keep in the code is the rootservices path. Doing so requires a couple of extra REST calls that I'd like to avoid, however. Is it necessary to follow this procedure, or can I save the workitems service path? Is it likely to change? 

If there is no configuration changes, such as server rename, version upgrade and etc, the path/URL stays the same.

Is there a way to get a list of resources, such as the categories for filedAgainst? I haven't been able to figure out how to get the references that I need for my queries through the REST interface. 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Sep 01 '15, 3:39 p.m.

Question was seen: 5,120 times

Last updated: Sep 15 '15, 1:37 p.m.

Confirmation Cancel Confirm