@@ -33,6 +33,13 @@ type TicketComment struct {
33
33
Via * Via `json:"via,omitempty"`
34
34
}
35
35
36
+ // RedactTicketCommentRequest contains the body of the RedactTicketComment PUT request
37
+ type RedactTicketCommentRequest struct {
38
+ TicketID int64 `json:"ticket_id"` // Required
39
+ HTMLBody string `json:"html_body,omitempty"`
40
+ ExternalAttachmentUrls []string `json:"external_attachment_urls,omitempty"`
41
+ }
42
+
36
43
// NewPublicTicketComment generates and returns a new TicketComment
37
44
func NewPublicTicketComment (body string , authorID int64 ) TicketComment {
38
45
public := true
@@ -111,3 +118,16 @@ func (z *Client) MakeCommentPrivate(ctx context.Context, ticketID int64, ticketC
111
118
_ , err := z .put (ctx , path , nil )
112
119
return err
113
120
}
121
+
122
+ // RedactTicketComment permanently removes words, strings, or attachments from a ticket comment
123
+ //
124
+ // ref: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#redact-ticket-comment-in-agent-workspace
125
+ func (z * Client ) RedactTicketComment (
126
+ ctx context.Context ,
127
+ ticketCommentID int64 ,
128
+ body RedactTicketCommentRequest ,
129
+ ) error {
130
+ path := fmt .Sprintf ("/api/v2/comment_redactions/%d.json" , ticketCommentID )
131
+ _ , err := z .put (ctx , path , body )
132
+ return err
133
+ }
0 commit comments