- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2022 08:32 AM
We have one catalogue form in that catalogue with one "Specify end date of roles access" Date field, and an email notification should be sent to a specific group based on that date.
Please find the Catalogue form screen shot, This date is always a future date, and only on that date is an email notification sent to the group.
Please help me on this how to do this requirement.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2022 06:32 AM
Hi @Sravani47,
Try this updated scripts and modified it accordingly.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('cat_item', "sys_id_of catalog_item");
gr.query();
while (gr.next()) {
var temp = gr.variables.end_date_of_roles_access.toString();
if (new GlideDateTime(temp).getDate.getNumericValue() == new GlideDateTime(temp).getDate().getNumericValue()) {
// gs.info("RITM Number: "+ gr.number + new GlideDateTime(temp).getDate.getNumericValue() + " - " + new GlideDateTime(temp).getDate().getNumericValue())
gs.eventQueue('Request.RoleRevoke.Enddata', gr, gr.assigned_to.toString()); // fire this events
}
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 04:05 AM
1) added log gr.variables.end_date_of_roles_access.getDisplayValue()
Output is same result undefined.
2) logged gs.nowDateTime()
Output is current date and time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 04:08 AM
What about gr.variables.end_date_of_roles_access? What is the log for that?
Thanks & Regards,
Vikrant Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 04:11 AM
gr.variables.end_date_of_roles_access
for this also same undefined

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 04:22 AM
This is the right syntax, either the field is not on RITM, or the variable is empty.
Can you log gr.number and check what is the value of the field for that RITM?
Thanks & Regards,
Vikrant Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 04:32 AM
gs.info("RITM number : "+gr.number);
display all RITM number.