- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 05:07 AM
in asset email notification part , needs to trigger a mail if asset recovery changed to upgrade to 'OWNED BY USER'
the condition is that , we need to configure 'inactive owned by too , if user is inactive that email trigger needs to return back to sent to event creator
now challenge is how to put a condition/script to checck if owned by user is inactive so that it will trigger a mail
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018 01:27 AM
Hi Sukran,
Try piece of code mentioned below-
\\Get user's active value
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", current.owned_by);
gr.query();
var active;
if(gr.next()){
active = gr.active;
}
Hope this is helpful for you
Regards
Jyoti Soni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018 02:00 AM
Hello,
I think the best option here is to create business rule to check if the owned by is inactive. Then you need to use the eventsqueue functionality.
By this you have the control on the parameter you will be using to the recipient.
in your br you have something like this:
if(current.u_inactive_owned.active == 'false'){
var gr = new GlideRecord("sys_user");
if(gr.get(gs.getUserID()){
gs.eventQueue('user.view',current,gr.email);
}
}else{
gs.eventQueue('user.view',current,current.u_inactive_owned);
}
Thanks
Dante