Ticket is not getting created through Scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:38 AM
Hi,
I have created an automatic ticket for every first day of the week and auto-assign to a particular user through scheduled job but that ticket is not getting created.
The below is the code so can anyone please help on this, It will be usefull.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 09:37 AM - edited 08-01-2024 10:12 AM
Hi @mania ,
Few things here
1)Did u try this code in the background script , you will be able to identify the issue.
2)Did u try executing using execute now button here
3)Use finction to call this block of code
something like :
createInc();
function createInc(){
//incident creation logic
}
4)pls replace hardcoded values with system property and use setValue instead direct assignmnet
OR
I would write a scheduled flow instead scheduled job.
Hope this helps!!
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 10:04 AM
It seems the issue with line 2.
It seems in your case the GlideRecord didn't initialized properly. If it's initialized properly, then it should appear in Italic.
Try removing it and re-write it again.
Mark it as Helpful and mark it as Solved, if this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 10:37 AM
Hi @mania,
I have written below code which is creating an incident using schedule job.
does your code create a ticket once you click on execute now? or create ticket but not automatically?
Please mark helpful & correct answer if it's really worthy for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 10:15 PM
Thanks for your Responded!
Yes, once I clicked on execute now button it is created a ticket and not created automatically. I want automatically create the record.
Please help on this, it will be usefull.
Thanks!