- 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-20-2018 06:13 AM
Have you tried dot walking to the Active field on the user table from the Owned by user reference field on the CI.
If Owned by.active == false in the condition builder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018 01:16 AM
How to set up in the email notification condition as ownedby.active == false?

- 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 01:32 AM
In condition filed scroll down and click on show related fields-->check for owned by->user fields, click on that and again in drop down you will find active option