incidents view redirect to portal view

Nitya2
Kilo Guru

we are using below email script , when we click on 'Take me in to the incident' its navigating to  itil(native view).

kindly help me to redirect to portal view .

email script -

 

(function runMailScript(current, template, email, email_action, event) {
	var link = current.getLink();
		if (email_action.name != "Incident Resolved") {
		template.print('<p><font size="3" color="#808080" face="helvetica">');
		template.print(gs.getMessage('You can view all the details of the incident by following the link below:'));
		template.print('</font></p>');
	}
	else {
		template.print('<p><font size="3" color="#808080" face="helvetica">');
		template.print(gs.getMessage('If you feel the issue is not resolved, please click the following link and reopen your incident:'));
		template.print('</font></p>');
	}
	template.print('<font face="helvetica">');
	
	var backgroundColor = 'background-color: #278efc;';
	var border = 'border: 1px solid #0368d4;';
	var color = 'color: #ffffff;';
	var fontSize = 'font-size: 16px;';
	var fontFamily = 'font-family: Helvetica, Arial, sans-serif;';
	var textDecoration = 'text-decoration: none; border-radius: 3px;';
	var webKitBorder = '-webkit-border-radius: 3px;';
	var mozBorder = '-moz-border-radius: 3px;';
	var display = 'display: inline-block;';
	var padding = 'padding: 5px;';
	
	if (email_action.name == "Incident Survey") {
		color = 'color: #343d47;';
		backgroundColor = 'background-color: #e6e8ea;';
		border = 'border: 1px solid #bdc0c4;';
	}
	template.print('<a href="' + link + '"');
	template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
	template.print('">');
	template.print(gs.getMessage('Take me to the Incident'));
	template.print('</a>');
	template.print('</font>');
	template.print('<br><br>');
	template.print('<p><font size="3" color="#808080" face="helvetica">');
	template.print('Thank you.');
	template.print('</font></p>');
})(current, template, email, email_action, event);

 

1 ACCEPTED SOLUTION

Remove this from your code

var link = current.getLink();

 

add below code

var link = gs.getProperty('glide.servlet.uri') + "sp?sys_id=" + current.getUniqueValue() + "&view=sp&id=ticket&table=incident";
 
Thanks,
Shakeel Shaik 🙂

View solution in original post

13 REPLIES 13

Hi Nitya

 

Go to Portal, Once open any one incident record in Portal view and copy the URL.

 

and then customize it or share here, Community will help

Thanks,
Shakeel Shaik 🙂

and I think, user don't have respective role to access in portal.

try with other users

Thanks,
Shakeel Shaik 🙂

Hi Nitya

 

Go to Portal, Once open any one incident record in Portal view and copy the URL.

 

and then customize it or share here, Community will help

Thanks,
Shakeel Shaik 🙂

Nitya2
Kilo Guru

when i access incident in portal below url

 

dev1234..service-now.com/sp?sys_id=23f18acd8773b41048cb87b6cebb352c&view=sp&id=ticket&table=incident

var link = gs.getProperty('glide.servlet.uri') + "sp?sys_id=" + current.getUniqueValue() + "&view=sp&id=ticket&table=incident";
Thanks,
Shakeel Shaik 🙂