Unable to retrieve property value using gs.getProperty('') in scheduled report (sysauto_report)

pavan_yadav
Tera Contributor

I'm trying to use var prop = gs.getProperty('some.property.name'); inside a scheduled report (sysauto_report), but the value of prop keeps returning undefined. Can anyone confirm if gs.getProperty() works in scheduled reports, or if there's a limitation in that context?

 

Thanks,
Pavan.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@pavan_yadav 

I believe it has something to do with the sandboxing.

Check this link which talks the same which all classes are not allowed

Script sandbox property

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

31 REPLIES 31

You are sending SLA reports? So why not schedule them at a specific time? Or are you bothering people with emailing these multiple times a day? I hope you do realize that such emails will end up in email rules to not clutter inboxes. 
Whenever you need to send reports multiple times a day, you should challenge the person asking it and ask them why not put these on a dashboard. 

And if it is for alerting (be aware that this ticket is going to run out of SLA), that shouldn't be through a report.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi @Mark Manders ,

What I observed is, schedule report will running periodically, in the SLA we declared a time period to run, but in the schedule report executing periodically 10min, and this will send notification in weekdays(Mon to Fri) even in SLA we declared 9 to 7 also this report will send notification, its not about pause SLA, my issue is about restrict sending notification to user after 7 pm and before 9am, so this is the right way to approach,
is there any other way to restrict schedule report to do not send after 7pm?
please let us  know.