Script include which is triggering from scheduled job is giving performance issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi
To update the "age of incident" field value (like 0-3 days, 15 days, more than 15 days), the below scheduled job and script include written but it is giving performance issues due to looping all the incidents on hour basis and populating/caluculating the "age of incident" field. Could you please suggest another approach which should give same functionality with no performance issues
Schedule job running on hourly basis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited an hour ago
Hi @Anusha Dande,
I see you have there gr.update(), if you weren't updating the records, I would recommend to go with GlideAggregate which is optimal for counting the records without making any changes to them, while GlideRecord is not good for hourly execution. But if you want to know the hourly number of records (what is it good for???) then GlideAggregate shall be doable.
Also, if you want to see only the number of records, why don't you create a report/dashboard?
Please explain the motivation why do oyu need to check incidents hourly, is it some micro-manager stepping on agent's neck? Or what's the purpose? 😛
EDIT: another thing is the trigger, you can minimise the amount by proper condition like created in last 30 days and only active ones, not checking 2 years old incidents being already closed...
No AI was used in the writing of this post. Pure #GlideFather only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi Patron,
Thank you for the response.
The purpose of the script is to auto populate the value of "age of incident"(string) field irrespective of its state and this script is configured long back and deactivated as per the suggestion of servicenow support team due to performance issues. However, need replacement script which has to give same functionality.
Could you please help me with alternative script if possible
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
41m ago
Hi @Anusha Dande,
in that case I would suggest to execute it early morning or late night hours and to execute it just once or twice a day.
Having such a script executed hourly is not good idea or as I said above it must be well triggered to check and update only relevant incidents..
No AI was used in the writing of this post. Pure #GlideFather only
