ITSMA ChatOps Forum
cancel

Customize Service Manager Workflow for Translation

Highlighted
Andy_T
Acclaimed Contributor

Customize Service Manager Workflow for Translation

Dear Friends, I am brand new in the Service Manager world. One of my clients reched out to me asking they need Translation help with Service manager. For example - lets say a User - submitted a ticket in French but we want the helpdesk person to see the ticket in English. Help desk person responds to that ticket / resolves the ticket in English but the communication goes back to the original user in French.

But for this translation we have to use company's Translation service (api over HTTP). How can I integrate these translation services in Service Manager workflow. Any suggestions would be highly appreciated.

1 REPLY
Henrry_han
Member

Re: Customize Service Manager Workflow for Translation

Hi,

I think this is about how to call external api over http in Service Manager. Here is an example for SM JS calling restful apis

var httpHeaders = new Array();

var contentHeader = new Header();
contentHeader.name = "Content-Type";
contentHeader.value = "application/json";
httpHeaders.push(contentHeader);
//Authentication
var authHeader = new Header();
authHeader.name = "Cookie";
var token = getLwssoToken(system.functions.operator()); //
authHeader.value = "LWSSO_COOKIE_KEY=" + token;

httpHeaders.push(authHeader);

var url = "http://example.com:8088/api/XXX/";

var requestBody = request;

try {
var response = doHTTPRequest("POST", url, httpHeaders, requestBody);
}
catch (ex) {
print("Exception for connecting chat service: " + ex);
}

Then you can create a new Javascript ruleset to call this js, and attache the ruleset to your workflow.

//Add this to "OnDomLoad" event