Hi!
According to docs I can add a note to ticket when creating it via REST API:
I do a http request to /api/v1/tickets endpoint. The payload is:
curl -H "Authorization: Token token={token}" -H "X-On-Behalf-Of: user@email.asd" -H "Content-Type: application/json" -d '{"title":"Title","group":"Users","article":{"body":"Body","type":"note","internal":false,"sender_id":2},"note":"Note"}' http://my_zammad/api/v1/tickets
The API response is:
{"id":38,"group_id":1,"priority_id":2,"state_id":1,"organization_id":null,"number":"95035","title":"Title","owner_id":1,"customer_id":4,"note":"Note","first_response_at":null,"first_response_escalation_at":null,"first_response_in_min":null,"first_response_diff_in_min":null,"close_at":null,"close_escalation_at":null,"close_in_min":null,"close_diff_in_min":null,"update_escalation_at":null,"update_in_min":null,"update_diff_in_min":null,"last_contact_at":null,"last_contact_agent_at":null,"last_contact_customer_at":null,"last_owner_update_at":null,"create_article_type_id":10,"create_article_sender_id":2,"article_count":1,"escalation_at":null,"pending_time":null,"type":null,"time_unit":null,"preferences":{},"updated_by_id":4,"created_by_id":4,"created_at":"2019-06-14T08:27:17.232Z","updated_at":"2019-06-14T08:27:17.384Z","article_ids":[95],"ticket_time_accounting_ids":[]}
You can see that the note was added successfully. It is present in the response.
Next I do a request to /api/v1/tickets/ to fetch that newly created ticket:
curl -H "Authorization: Token token={token}" -H "X-On-Behalf-Of: user@email.asd" http://my_zammad/api/v1/tickets/38
The API response is:
{"id":38,"group_id":1,"priority_id":2,"state_id":1,"organization_id":null,"number":"95035","title":"Title","owner_id":1,"customer_id":4,"note":"Note","first_response_at":null,"first_response_escalation_at":null,"first_response_in_min":null,"first_response_diff_in_min":null,"close_at":null,"close_escalation_at":null,"close_in_min":null,"close_diff_in_min":null,"update_escalation_at":null,"update_in_min":null,"update_diff_in_min":null,"last_contact_at":null,"last_contact_agent_at":null,"last_contact_customer_at":null,"last_owner_update_at":null,"create_article_type_id":10,"create_article_sender_id":2,"article_count":1,"escalation_at":null,"pending_time":null,"type":null,"time_unit":null,"preferences":{},"updated_by_id":4,"created_by_id":4,"created_at":"2019-06-14T08:27:17.232Z","updated_at":"2019-06-14T08:27:17.384Z"}
The note is there too.
But I can’t see it on the ticket’s page when checking Zammad Dashboard. Only title and body can be seen:
Just to clarify. What I’m going to reach here is to store additional information for the ticket, but I don’t want to keep it in an article.
Perhaps I’m doing smth wrong or there might be a better way for this. I would be grateful for any help.