WS API: How to update a TestFolder

Document ID : KB000057564
Last Modified Date : 14/02/2018
Show Technical Document Details

Issue

Updating a TestFolder's project returns Validation error: TestFolder.Children is an invalid relationship.

Resolution

Moving a TestFolder from one project to another

TestFolders in CA Agile Central can be successfully moved from one project to another as long as they are not a part of a test folder hierarchy.?

Here is a curl command that that changes Project on TestFolder :

curl --header "zsessionid:_abc123" -H "Content-Type: application/json" -d"{\"TestFolder\":{\"Project\":\"/project/12352814790\"}}" https://rally1.rallydev.com/slm/webservice/v2.0/testfolder/12517635446

However attempting to change project on a child folder while its parent folder remains in the current project will return this error
Updating a TestFolder's project returns Validation error: TestFolder.Children is an invalid relationship.

{"OperationResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": ["Validation error: TestFolder.TestCases is an invalid relationship. One or more of the artifacts is in a different project.", "Validation error: TestFolder.TestCases is an invalid relationship. One or more of the artifacts is in a different project.", "Validation error: TestFolder.Parent is an invalid relationship. One or more of the artifacts is in a different project."], "Warnings": []}}

Moving a TestFolder from one parent TestFolder to another:

This curl commands below updates the same TestFolder by setting its Parent to another TestFolder in the same project.
In this example we will move TF2 under TF5:

User-added image

After we run this command:

curl --header "zsessionid:_abc123" -H "Content-Type: application/json" -d"{\"TestFolder\":{\"Parent\":\"/testfolder/13987494420\"}}" https://rally1.rallydev.com/slm/webservice/v2.0/testfolder/12517635446

TF2 is successfully moved to another folder, TF5:

User-added image