Email notification for behalf of user

B Ashok
Tera Guru

Hi Team, 

 

I have created below script to send notification with Hyper link ( on incident and Request), but when ITIL user raise request on behalf of  user, but the end user getting back-end link instead of sp link, I would like to add behlaf of condition where to write, please help. 

 


var currentUser = gs.getUser().getUserByID(current.caller_id);

if (currentUser.hasRoles()) {
template.print('now/workspace/agent/record/incident/' + current.sys_id);
} else {
template.print('rnd?id=ticket_rnd&table=incident&sys_id=' + current.sys_id +'&view=sp');
}

 

Thanks 

Ashok 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@B Ashok 

Did you check by adding logs if it's going inside IF or ELSE

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

B Ashok
Tera Guru

As the request/incident raised by ITIL user ( who has roles ) If condition triggering and then both Requestor(ITIL user) and behalf of ( end user) are getting Bankedn link ( template.print('now/workspace/agent/record/incident/' + current.sys_id); )

 

But I need Behalf of user should get service portal link though ITIL user raise request on behalf of normla user. 

 

Thanks

Ashok