create a incidents automatically on a specific date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 07:24 AM
I would like to create a schedule that create a incident on a specific date.
from example
08/07/2025
15/07/2025
08/08/2025
etc
I have created a template to create the incident.
I can get it working on the week/day etc.
but can not see a why that I can type my own date's in for it to run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2025 07:37 AM
To create incidents on specific, custom dates like 08/07/2025, 15/07/2025, 08/08/2025, etc., using a schedule in ServiceNow, you’ll need to go beyond the standard Recurrence options in Scheduled Jobs or Scheduled Script Executions. These built-in tools don’t support arbitrary date inputs out-of-the-box. Here’s a practical approach to achieve it:
Create a custom table (e.g., u_incident_schedule_dates) with a single Date/Time field to store all the desired incident creation dates.
Populate this table with the dates you want incidents to be generated (08/07/2025, 15/07/2025, 08/08/2025, etc.).
Create a Scheduled Script Execution (run daily, for example), that:
Queries the custom table for any records where the date equals today’s date.
For each match, uses the Incident Template to create an incident via GlideRecord or by calling GlideRecord.insert() with prefilled fields from your template.
Here is a basic example script for the Scheduled Script Execution:
var today = new GlideDate();
var incidentDateGR = new GlideRecord('u_incident_schedule_dates');
incidentDateGR.addQuery('u_date', today);
incidentDateGR.query();
while (incidentDateGR.next()) {
var incident = new GlideRecord('incident');
incident.initialize();
// Apply values from your template
incident.short_description = 'Scheduled Incident';
incident.category = 'inquiry';
incident.impact = 2;
incident.urgency = 2;
incident.insert();
}Make sure to align field names and values according to your template. This way, you maintain a flexible list of custom dates that can be managed manually or via integration, and the automation will trigger based on those dates. If this resolves your issue, please consider marking the response as solved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 03:04 AM
Hi JessicaLanR
Thanks you for your help.
I have got it working in Dev now
Regards Dave
