Question

I am writing an application using RallyRestToolkitFor.NET . I am able to fetch listed fields for all the user stories for a specific workspace. Now I want to fetch stories under a specific "Epic". I am not able to find the way to do this in documentation link.

I want to know if it is possible what I am trying to do. And if the answer is yes kindly show me the way. A link or sample code or a pointer, I appreciate any help.

Thanks, Sagar.

Was it helpful?

Solution

Here is a code that gets stories of a specific epic:

namespace FindChildren
{
    class Program
    {
        static void Main(string[] args)
        {
            RallyRestApi restApi;
            restApi = new RallyRestApi("user@co.com", "secret", "https://rally1.rallydev.com", "v2.0");

            String projectRef = "/project/12352814790";     //replace this OID with an OID of your project

            Request sRequest = new Request("HierarchicalRequirement");
            sRequest.Project = projectRef;
            sRequest.Fetch = new List<string>() { "FormattedID", "Name", "Children" };
            sRequest.Query = new Query("FormattedID", Query.Operator.Equals, "US384");
            QueryResult queryResults = restApi.Query(sRequest);

            foreach (var s in queryResults.Results)
            {
                Console.WriteLine("FormattedID: " + s["FormattedID"] + " Name: " + s["Name"]);
                Console.WriteLine("Collection ref: " + s["Children"]._ref);
                Request childrenRequest = new Request(s["Children"]);
                QueryResult queryChildrenResult = restApi.Query(childrenRequest);
                foreach (var c in queryChildrenResult.Results)
                {
                    Console.WriteLine("FormattedID: " + c["FormattedID"] + " Name: " + c["Name"]);
                }

            }
        }
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top