Update the fields of a status automation. Send only the fields to change. You cannot change id, created_at, updated_at. Dates use the ISO 8601 format. The automation is validated when you change its trigger, entity type or output. You must be an administrator.
Body
Required
-
Type of entity of the tasks (asset, shot, sequence, episode or edit). Empty means asset.
Default value is
asset. -
Conditions that start the automation. It runs when a comment changes a task status and turns the group from false to true. A condition is met when every task of its task type on the entity has one of its statuses, and a condition on a task type that the entity has no task of is ignored. Each task type appears once and belongs to the entity type. With a status output, the task type that the automation changes cannot be a condition, and a condition on a task type after it in the production never starts the automation: under and it still has to be met, under or it is left out. Other keys are refused.
Additional properties are NOT allowed.
-
Task type that starts the automation, with in_task_status_id, when in_conditions is not given or sent back as stored. Both null next to in_conditions, they are ignored. The pair cannot clear the trigger: archive the automation instead. Refused on an automation whose trigger has several conditions or statuses.
-
Task status that starts the automation, see in_task_type_id
-
Field that the automation changes. ready_for applies to assets only.
Values are
statusorready_for. -
Task type that the automation changes
-
New task status, null with a ready for output
-
With a status output, the change applies only to a task in one of these statuses. Empty or null means always.
-
Copy the last preview to the changed task, from the task of the first condition the entity has with and, from the commented task with or
Responses
-
The updated status automation
-
The body is not valid, a date is not valid, a field breaks a database constraint, or the automation is not valid, for example "Trigger operator must be 'and' or 'or'.", "Task type Layout is not a task type of assets.", "Task type Layout appears in two conditions: merge their statuses into one." or "This automation has several trigger conditions: update it through in_conditions."
-
You are not an administrator
-
The status automation does not exist
curl -X PUT "http://api.example.com/data/status-automations/a24a6ea4-ce75-4665-a070-57453082c25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"field_name": "ready_for",
"field_value": "approved"
}'
import requests
url = "http://api.example.com/data/status-automations/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"field_name": "ready_for",
"field_value": "approved"
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
{
"entity_type": "asset",
"in_conditions": {
"operator": "and",
"conditions": [
{
"task_type_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"task_status_ids": [
"c24a6ea4-ce75-4665-a070-57453082c250"
]
},
{
"task_type_id": "d24a6ea4-ce75-4665-a070-57453082c250",
"task_status_ids": [
"c24a6ea4-ce75-4665-a070-57453082c250",
"e24a6ea4-ce75-4665-a070-57453082c250"
]
}
]
},
"in_task_type_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"in_task_status_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"out_field_type": "status",
"out_task_type_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"out_task_status_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"out_only_if_task_status_ids": [
"string"
],
"import_last_revision": true,
"archived": false
}
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"entity_type": "asset",
"in_conditions": {
"operator": "and",
"conditions": [
{
"task_type_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"task_status_ids": [
"c24a6ea4-ce75-4665-a070-57453082c250"
]
},
{
"task_type_id": "d24a6ea4-ce75-4665-a070-57453082c250",
"task_status_ids": [
"c24a6ea4-ce75-4665-a070-57453082c250",
"e24a6ea4-ce75-4665-a070-57453082c250"
]
}
]
},
"in_task_type_id": "string",
"in_task_status_id": "string",
"out_field_type": "status",
"out_task_type_id": "f24a6ea4-ce75-4665-a070-57453082c250",
"out_task_status_id": "a34a6ea4-ce75-4665-a070-57453082c250",
"out_only_if_task_status_ids": [
"string"
],
"import_last_revision": false,
"archived": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}