Hey Derek,
Most likely the error you're getting is because your TestSet object isn't properly constructed. I've uploaded an example for you that's working. Notice in that example:
- Line 26: the TestSet is constructed by iterating over the response objects.
- The TestCases are added into an array which is passed to the addCollectionItems function.
To use this example, simply replace lines 9-11 with your ApiKey, Workspace and Project names. Also, replace the filters in lines 14 and 30 to match what you need to get your the test set and test cases you need.
If you have any questions, please let me know.
If you'd like to share your code that throws that error, please feel free to include your file. The _type will be part of the TestSet object (or any Rally object) only once it's constructed, otherwise it's unset. Perhaps you are working with raw data (such as the response objects) but didn't properly cast it into the TestSet object. It's just my guess.
I hope this helps. Let me know.
Sagi
Original Message:
Sent: 07-01-2019 08:58 PM
From: Derek Bergin
Subject: Using pyral to update collections
Pyral 1.42. Need to update the TestCases collection in a TestSet.
The addCollectionItems method requires a target with a valid _type attribute. The documentation seems to indicate that this class of object is returned from a .get() call. I can't line these up to give me a collection that will work with addCollectionItems nor can I see what the entity string would be.
I also tried just by supplying the list of test cases in a post call - that didn't work either.