Jared Stroebele
Jared Stroebele

Reputation: 584

How can I query for a Test Folder in Rally Rest tookit for Java?

Here is the basic code i am attempting to use:

  //create new QueryRequest
  QueryRequest tests = new QueryRequest("Test Case");

  //Gets the information from QueryFilter
  tests.setFetch(new Fetch("FormattedID","Name","Owner","Test Folder"));

  //checks to see if the test Case's test folder matches the given one
  testFolderFilter =  new QueryFilter("Test Folder", "=", testFolder);

  // set query filter
  tests.setQueryFilter(testFolderFilter); 

  // Query Rally
  QueryResponse queryResponse = restApi.query(tests);

I have sucessfully done it using the Name and FormattedID in place of Test Folder so I assume I just need to use a different string for Test Folder. Any suggestions are welcome.

Examples were of no help to me but they can be found at: http://www.rallydev.com/developer/java-toolkit-rally-rest-api

Upvotes: 2

Views: 1944

Answers (1)

user984832
user984832

Reputation:

Your code looks great, this should work for you with the following minor change to your query syntax:

  testFolderFilter = new QueryFilter("TestFolder.Name", "=", testFolder);

A handy place to test your query syntax interactively before running in code is the Rally webservices API documentation:

https://rally1.rallydev.com/slm/doc/webservice/

Each artifact has a handy "Query" dialog that lets you run example query syntax to see what works and what doesn't.

Upvotes: 2

Related Questions