3
votes

I am trying to find a way I can save queries by grabbing the Task Names & IDs with my Defects and HierarchicalRequirements using the RallyDev API.

Currently Using:

https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=((Iteration.Oid%20=%20%221234567890%22)%20and%20(Owner.Name%20=%20%[email protected]%22))&fetch=Tasks,FormattedID,Name&order=Rank

This only returned the Tasks _ref, Type & Count.

Duplicate of: (But this doesn't work anymore with API v2.0)

Can you GET Rally API requirements, defects, and all tasks with one query

1

1 Answers

2
votes

In 1.x versions of WSAPI it was possible to fetch child collections of an object. HierarchicalRequirement.Defects, TypeDefinition.Attributes and HierarchicalRequirement.Tasks are common examples of these child collection fields.

For performance reasons it is no longer possible to do this in 2.x versions of WSAPI. Now each object collection has its own unique ref uri. This means these collections can now be separately queried, paged, sorted and filtered. Fetching Defects on a story will now return an object containing the count and the uri from which to retrieve the collection data. The ref uri is generally of the format /type/oid/collection (e.g. /hierarchicalrequirement/12345/defects).

However, you may use this syntax when querying on a workproduct type, e.g. defect fetch=Tasks:summary[State;Owner]

This query will return a summary of tasks with formatted id and name:

https://rally1.rallydev.com/slm/webservice/v2.0/defect?fetch=Tasks:summary[FormattedID;Name]&pagesize=200

enter image description here