Email notification for behalf of user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 05:30 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 05:47 AM
Did you check by adding logs if it's going inside IF or ELSE
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:17 AM
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