Update the fields of a comment. Send only the fields to change. You cannot change id, created_at, updated_at, object_id, mentions and department_mentions. Dates use the ISO 8601 format. The mentions are computed again from the text. You become the editor of the comment. An administrator can change all the fields. Other users must be in the team of the project. A manager of the project can change all the fields. Other users must be able to read the comment and cannot change for_client. Only the author can change the fields other than pinned and checklist. Only a supervisor of the department of the task type, or without a department, can change pinned. Only the author, an assignee of the task or such a supervisor can change checklist. You cannot give the comment to another person or move it to another task. To change task_status_id, you must have action access to the task and access to the status. A status change resets the task data.
curl -X PUT "http://api.example.com/data/comments/a24a6ea4-ce75-4665-a070-57453082c25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"text": "Updated comment text",
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"pinned": true,
"checklist": [
{
"text": "Item 1",
"checked": false
}
]
}'
import requests
url = "http://api.example.com/data/comments/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"text": "Updated comment text",
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"pinned": true,
"checklist": [
{
"text": "Item 1",
"checked": false
}
]
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
{
"text": "Updated comment text",
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"pinned": true,
"checklist": [
{
"text": "Item 1",
"checked": false
}
]
}
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"object_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"person_id": "c24a6ea4-ce75-4665-a070-57453082c250",
"task_status_id": "d24a6ea4-ce75-4665-a070-57453082c250",
"text": "Updated comment text",
"pinned": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}