How can I get a list of items in a Rally instance via the REST API?

I want to get the list of items in the view lookup..but i just cant find what to query for that..i have tries everything but i just dont seem to get how to do it

I have even tried using

https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true

but that only fetches me the worspace and projects

Upvotes: 1

Views: 2147

Answers (1)

nickm
nickm

Reputation: 5966

I am not sure what you mean by view lookup. In any case, it is not possible to query on all work items in a subscription. Here is an example of a query on all defects in a workspace, when Name,FormattedID,State are being fetched:

https://rally1.rallydev.com/slm/webservice/v2.0/defect?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111&fetch=Name,FormattedID,State

All queries on work items are workspace scoped. You do not have to provide workspace explicitly as in the example above. If you are currently logged in to Rally in another tab of the same browser the context is already set, and this endpoint will work too:

 https://rally1.rallydev.com/slm/webservice/v2.0/defect?&fetch=Name,FormattedID,State

You may want to narrow a scope by using a query parameter, e.g.

https://rally1.rallydev.com/slm/webservice/v2.0/defect?&query=(State = Open)&fetch=Name,FormattedID

Also, v2.0 removed the ability to return child collections in the same response for performance reasons. Now fetching a collection will return an object with the count and the url from which to get the collection data:

https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/7777/Workspaces

where 7777 is OID of the subscription.

If you want to replicate a query in a custom view in Rally UI, open the view to determine the conditions and then build a similar query. Here is an example of a query that imitates a custom view below:

https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=((Blocked = true) AND (Owner.UserName = [email protected]))

enter image description here

Upvotes: 2

Related Questions