set_attribute
Set or update a project attribute, like repository or branch, in Casefile. Changes log the old value and reason; creation logs an optional reason.
Instructions
Sets the value of a project attribute: a reference fact of the project such as its repository or main branch. One call both creates and changes; which entry it files follows from the attribute's state.
No attribute with this name, ignoring case: the attribute is created and an
attribute_createdentry is filed; the reason is optional.An attribute with another value: the value changes and an
attribute_changedentry is filed with the previous value; the reason is required.The same value: nothing changes and nothing is filed.
The name keeps the spelling it was created with; another spelling addresses the
same attribute and does not rename it. Attributes carry no types and no search:
the tracker stores the text and acts on none of it. A task token sets
attributes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Project key, case-insensitive. An unknown key is refused with `project_not_found` | |
| name | Yes | Attribute name: Latin letters, digits, `_` and `-`, at most 64 characters (`invalid_attribute_name` otherwise). Matching ignores case | |
| value | Yes | Attribute value: plain text up to 1000 characters, stored as sent and not interpreted by the tracker; a longer one is refused with `attribute_value_too_long` | |
| reason | No | Why the value changes. Required when the attribute already exists with another value (`attribute_reason_required` otherwise); optional when the call creates it. Filed in the entry with the previous and the new value | |
| idempotency_key | No | Retry key chosen by the caller, e.g. a UUID. A repeat with the same key and the same arguments returns the first result and creates nothing; the same key with other arguments is refused with `idempotency_key_reused`. A key is bound to the caller's token and kept for 24 hours |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| no | Yes | Number of the filed entry in the project's case (`TRK#7`); `null` when the value equals the current one and nothing was filed | |
| name | Yes | Name as stored: the spelling the attribute was created with | |
| value | Yes | ||
| project_key | Yes |