Notification not working in scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:02 AM
HI,
I created a scheduled job in scoped application which based on the expire date email will be sending in advance for alert.
the day calculation i havent shared here, but i am able see the logs but notification is not getting triggered. For
example : i can post the logs which received for 1 day record.
Certificate expires 1 days from today: Facility Management Appl - L2owned by - Christoffer A.
*** Script: Certificate expires 1 days from today: Facility Management Appl - L2owned by - Christoffer A.
Evaluator: com.glide.script.RhinoEcmaError: "applicationGR" is not defined. script : Line(80) column(0) 77: if (days == 1) { 78: 79: gs.info("Certificate expires 1 days from today: " + managedByGroup + "owned by - " + ownedBy); ==> 80: gs.eventQueue('sn_disco_certmgmt.1day',applicationGR , managedByGroup, ownedBy); 81: } 82:
*********************************************************************************************************************
gs.eventQueue('sn_disco_certmgmt.1day','', managedByGroup, ownedBy);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:11 AM
@AnandKumar1 From the error it appears that the applicationGR object you are passing on line number 80
is not defined. Please check your code at line number 80 and see if the applicationGR object is defined correctly.
==> 80: gs.eventQueue('sn_disco_certmgmt.1day',applicationGR , managedByGroup, ownedBy);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:20 AM
Hi Sandeep,
Thanks for your response. applicationGR i am using to glide cmdb_ci_service_discovered to get the value of ownedby and group.
And i am storing the values back to the variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:22 AM
Hi @AnandKumar1, Have you declared the commonname (line 4) variable anywhere in your script?
var serverIdsArr = [];
var relationdata = new GlideRecord('cmdb_rel_ci');
relationdata.addEncodedQuery("parent.sys_class_name=cmdb_ci_certificate^type=6afd799338a02000c18673032c71b87b");
relationdata.addQuery('parent', commonname);
relationdata.query();
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:26 AM
Hi Sunil,
Thanks for your post.
yes i have declared. In the post i have only updated the limited script. Below i have posted my complete scheduled job script. I have declared it in Line No 7.