Sort test cases within a component item
Reorders test cases within a component item by providing a new sort order array. The sort order determines the display order of test cases in the UI and affects condition evaluation order. All test case IDs in the array must belong to the specified item.
POST
/projects/{projectId}/items/{itemId}/testcases/sortAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject UUID
itemIdstringrequiredComponent item UUID
Request body
requiredapplication/jsonnewSortOrderstring[]requiredArray of test case IDs in desired order
Responses
200Test cases successfully sorted
successboolean400Invalid projectId, itemId, or test case IDs format
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions or no access to project
404Project or item not found, or item does not belong to the project
Request
curl -X POST "https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/testcases/sort" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"newSortOrder": [
"e57dc37b-7693-4d06-b49c-17084b773aff",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
}'const response = await fetch("https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/testcases/sort", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"newSortOrder": [
"e57dc37b-7693-4d06-b49c-17084b773aff",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/testcases/sort",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"newSortOrder": [
"e57dc37b-7693-4d06-b49c-17084b773aff",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
},
)Response
{
"success": true
}Invalid projectId, itemId, or test case IDs format
Unauthorized - Invalid or missing authentication token
Insufficient permissions or no access to project
Project or item not found, or item does not belong to the project