WS API: How to update a TestFolder
search cancel

WS API: How to update a TestFolder

book

Article ID: 57564

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

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 Rally 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:<API Key - include the underscore before the key>" -H "Content-Type: application/json" -d"{\"TestFolder\":{\"Project\":\"/project/<PROJECT_OID>\"}}" https://rally1.rallydev.com/slm/webservice/v2.0/testfolder/<TEST_FOLDER_OID>

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:

After we run this command:

curl --header "zsessionid:<API Key - include the underscore before the key>" -H "Content-Type: application/json" -d"{\"TestFolder\":{\"Parent\":\"/testfolder/<PARENT_TEST_FOLDER_OID>\"}}" https://rally1.rallydev.com/slm/webservice/v2.0/testfolder/<TEST_FOLDER_OID>

TF2 is successfully moved to another folder, TF5: