Add a comment to the ticket
Hi,
Is it possible to add comments using ZAF client? Tried to use:
client.invoke('comment.appendText', 'some text')
client.set('comment.text', 'some text')
They both just add a text to the texfield but do not publish it.
They both just add a text to the texfield but do not publish it.
-
Hey Andrei,
You'll want to use the client.request method to make an api call to accomplish this.
Hope this helps!
-
You must use an API call. client.invoke or client.set both deal with the agent interface data - assignee, requester, fields values, etc but to update a ticket you must do like this :
client.get('ticket').then(function(response) {
let ticket = response['ticket'];
console.log(ticket['id']);
client.request({
url: '/api/v2/tickets/' + ticket['id'],
contentType: "application/json",
type: 'PUT',
data: JSON.stringify({
"ticket": {
"comment": {
"body": "Your comment goes here",
"public": false
}
}
})
}).then(function(response) {
console.log(response)
})
});
Por favor, entrar para comentar.
2 Comentários