Generate tasks from a component item
Generate tasks from a component item and its children. The endpoint recursively processes items (two levels deep), skips Epic items, and only creates tasks for items that don’t already have associated tasks. Can be used with either a Component ID or a ComponentItem ID.
POST
/projects/{projectId}/items/{itemId}/tasks/generateAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequireditemIdstringrequiredQuery 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/jsonitemTypestringrequiredType of item to generate tasks from
Allowed:
ComponentComponentItemResponses
200Tasks generated successfully
componentItemsCountnumberrequiredTotal number of component items processed
createdTasksCountnumberrequiredNumber of tasks created
tasksNumbersnumber[]requiredArray of task short numbers for created tasks
400Invalid request: invalid projectId, itemId format, or itemType value. Items may already be generating.
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to manage components or access to project denied
404Project not found, item not found, or item does not belong to the project
Request
curl -X POST "https://leadtime.app/api/public/projects/string/items/string/tasks/generate" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"itemType": "ComponentItem"
}'const response = await fetch("https://leadtime.app/api/public/projects/string/items/string/tasks/generate", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"itemType": "ComponentItem"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/string/items/string/tasks/generate",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"itemType": "ComponentItem"
},
)Response
{
"componentItemsCount": 8,
"createdTasksCount": 5,
"tasksNumbers": [
123,
124,
125,
126,
127
]
}Invalid request: invalid projectId, itemId format, or itemType value. Items may already be generating.
Unauthorized - Invalid or missing authentication token
Insufficient permissions to manage components or access to project denied
Project not found, item not found, or item does not belong to the project