Update an existing test case
Partially updates an existing test case for a component item within a project. Only provided fields will be updated. Editor content (description, steps, expectedResult) accepts HTML or Markdown input when provided.
PATCH
/projects/{projectId}/items/{itemId}/testcases/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject UUID
itemIdstringrequiredComponent item UUID. Items are the building blocks within components (Epics, Work Packages, Todo Lists, Test Suites).
idstringrequiredTest case UUID
Query parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsondescriptionstringTest case description in HTML or Markdown format
expectedResultstringExpected result in HTML or Markdown format
stepsstringTest steps in HTML or Markdown format
titlestringTest case title
Responses
200Test case updated successfully
descriptionstringrequiredTest case description in HTML format
expectedResultstringrequiredExpected result in HTML format
idstringrequiredTest case ID
stepsstringrequiredTest steps in HTML format
testCommentstring | nullTest comment in HTML format (optional)
testStatusstring | nullTest status (optional)
Allowed:
PassedPassedWithReservationsFailedtestedAtstring | nullDate when tested (optional)
testedBystring | nullUser ID who tested (optional)
titlestringrequiredTest case title
400Invalid request: validation errors or test case does not belong to project
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to manage components or access to project denied
404Project, item, or test case not found
Request
curl -X PATCH "https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "<p>Verify that users can log in with valid credentials.</p>",
"expectedResult": "<p>User is successfully logged in and redirected to dashboard.</p>",
"steps": "<ol><li>Navigate to login page</li><li>Enter credentials</li><li>Click login button</li></ol>",
"title": "Test login with valid credentials"
}'const response = await fetch("https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases/a1b2c3d4-e5f6-7890-abcd-ef1234567890", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"description": "<p>Verify that users can log in with valid credentials.</p>",
"expectedResult": "<p>User is successfully logged in and redirected to dashboard.</p>",
"steps": "<ol><li>Navigate to login page</li><li>Enter credentials</li><li>Click login button</li></ol>",
"title": "Test login with valid credentials"
})
});import requests
response = requests.patch(
"https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"description": "<p>Verify that users can log in with valid credentials.</p>",
"expectedResult": "<p>User is successfully logged in and redirected to dashboard.</p>",
"steps": "<ol><li>Navigate to login page</li><li>Enter credentials</li><li>Click login button</li></ol>",
"title": "Test login with valid credentials"
},
)Response
{
"description": "<p>Verify that users can log in with valid credentials.</p>",
"expectedResult": "<p>User is successfully logged in and redirected to dashboard.</p>",
"id": "550e8400-e29b-41d4-a716-446655440010",
"steps": "<ol><li>Navigate to login page</li><li>Enter credentials</li><li>Click login button</li></ol>",
"testComment": "<p>Test passed successfully.</p>",
"testStatus": "Passed",
"testedAt": "2024-01-01T00:00:00.000Z",
"testedBy": "550e8400-e29b-41d4-a716-446655440020",
"title": "Test login with valid credentials"
}Invalid request: validation errors or test case does not belong to project
Unauthorized - Invalid or missing authentication token
Insufficient permissions to manage components or access to project denied
Project, item, or test case not found