Create a new test case (acceptance test step) for a library component item
Creates a new test case for a library component item.
What are Test Cases? Test cases are individual test steps within a Test Suite. They document formal review and approval criteria for project results.
Test Case Structure:
- Title: Short, clear title (e.g., “Check confirmation email destination”)
- Description: What is being tested and why it matters
- Steps: Step-by-step instructions for running the test
- Expected Result: Describes the expected or correct system behavior
Evaluation: Test cases can be evaluated as Passed, Failed, or PassedWithReservations. The project is considered finished when all test cases have been passed successfully.
Editor content (description, steps, expectedResult) accepts HTML or Markdown input and returns HTML output. Only library component items (component.projectId is null) can have testcases created.
POST
/administration/project-components/item-details/{itemId}/testcasesAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
itemIdstringrequiredComponent item UUID. Items are the building blocks within components (Epics, Work Packages, Todo Lists, Test Suites).
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/jsondescriptionstringrequiredTest case description in HTML or Markdown format
expectedResultstringrequiredExpected result in HTML or Markdown format
stepsstringrequiredTest steps in HTML or Markdown format
titlestringrequiredTest case title. Test cases are individual test steps within a Test Suite. They document formal review and approval criteria for project results.
Responses
200
descriptionstringrequiredTest case description in HTML format
expectedResultstringrequiredExpected result in HTML format
idstringrequiredTest case ID
sortnumberrequiredSort order
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
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/administration/project-components/item-details/3047983b-d798-4aff-8dd4-628cf1900703/testcases" \
-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/administration/project-components/item-details/3047983b-d798-4aff-8dd4-628cf1900703/testcases", {
method: "POST",
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.post(
"https://leadtime.app/api/public/administration/project-components/item-details/3047983b-d798-4aff-8dd4-628cf1900703/testcases",
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",
"sort": 1,
"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"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions