Hello,
I was searching for such custom app but unfortunately i found some 2-3-4 years old topics with no resolution.
Bellow you can find the code to integrate into Agent ticket view a button in order to send the current ticket to solution Knowledge base.
jQuery(document).on('sidebar_loaded', function(event,data) {
jQuery("<br><input class='btn btn-primary' onClick='jQuery.fn.myFunction();' id='helpdesk_ticket_submit_kb' value='Create KBase Article'>").insertAfter("#helpdesk_ticket_submit_dup");
});
//Create article
jQuery.fn.myFunction = function(){
//alert('You have successfully defined the function!');
//Create Kbase
jQuery.ajax(
{
url: "https://yoursite.freshdesk.com/solution/categories/ecataegID]/folders/rfolderID]/articles.json",
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
headers: {"Authorization": "Basic " + btoa('ayourAgentAPIKEY]' + ":" + 'X')},
data: JSON.stringify('{ "solution_article": { "title": "{{ticket.subject}}", "status": 2, "art_type": 1, "description": "{{ticket.description}}", "folder_id": 17000119974 },"tags": {"name": ""} }'),
success: function(data, textStatus) {
alert(textStatus);
},
error: function(jqXHR, tranStatus) {
alert(jqXHR.responseText);
}
}
);
}
Your choice:
"description" : "{{ticket.description}" can contain also {{ticket.latest_public_comment}} or/and {{ticket.latest_private_comment}}