The CreatorCon Call for Content is officially open! Get started here.

Need help on mail script to link the ticket to Workspace instead of legacy view

Bird1
Mega Sage

Hello

I am working on mail script. I found the  ${URI_REF}  will link the ticket to legacy view only but we would like to promote more usage to Workspace, so we need to create the mail script that will show the ticket number and after we click the link it will go to the Workspace instead.

 

Sample

Now when click the ticket link which is from ${URI_REF}, it will go to

https://abc.service-now.com/nav_to.do?uri=%2Fx_alite_us_treas_0_us_treasury_request.do%3Fsys_id%3D2c1ce2f187c99550a62420e5cebb35a6%26sysparm_stack%3Dx_alite_us_treas_0_us_treasury_request_list.do%3Fsysparm_query%3Dactive%3Dtrue

 

but I need it to re-direct to

https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/2c1ce2f187c99550a62420e5cebb35a6

1 ACCEPTED SOLUTION

@Bird i got this working some how can you try this?

var agentURL = '<a href="' + gs.getProperty('glide.servlet.uri') + '/x/alite/treasury/record/'+ current.getTableName() + '/' + current.sys_id + '">' + 'Click Here'+ '</a>';
  template.print(agentURL + "<br />");

Mark this correct if it helps you

View solution in original post

10 REPLIES 10

You're right. x_alite_us_treas_0_us_treasury_request  table.

okay @Bird can you try this ?

(function runMailScript(current, template, email, email_action, event) {

var link = '<a href="/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/"'+current.sys_id.toString()+'>'+'click here'+'</a>';
template.print(link);

    
})(current, template, email, email_action, event);

Unfortunately, still the same result., no sys id. 😞

 

https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/

@Bird i got this working some how can you try this?

var agentURL = '<a href="' + gs.getProperty('glide.servlet.uri') + '/x/alite/treasury/record/'+ current.getTableName() + '/' + current.sys_id + '">' + 'Click Here'+ '</a>';
  template.print(agentURL + "<br />");

Mark this correct if it helps you

@Bird  updated the code can you try the above one ?