How to create scheduled task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 03:16 AM
Hi Everyone
i created the scheduled job with below script for creating task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 03:55 AM
You can set it
under for each record
caller / requested by = ABC
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 04:08 AM
For each unable to add filed value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 04:11 PM
It seems there’s something wrong here. I see in the scheduled job you're using the sc_task table, and the same approach should be applied here as well. However, the key point is determining the basis on which you're creating the sc_task and which request you're associating it with.
Here’s what you can do:
- When looking up records, search in the sc_task table.
- For the "Assigned to" field, use RITM.Requested for, and then add that in the flow.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 04:58 PM - edited 03-20-2025 05:05 PM
@Brahmi Pandla There are bunch of issues in your code,
1. Requested for that you see on the sc_task form is a field referencing sc_req_item form. Sc_task doesnt have a requested for field
2. Requested for and assignment groups are reference field so adding the sys id directly wont work.
3. Do you have to create an sc_task or just task? sc_task would need a RITM as well.
4. What is it that you are trying to achieve here?
5. Flow designer approach is easier to maintain and understand.
If you planning to use sctask and flow designer below would the approach
Overall
Details of each step
make sure to select the right RITM as shown above.
Please mark it as helpful or correct if it helped you resolve the issue or worked for you.
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 06:55 PM
Hi @Brahmi Pandla ,
you can schedule record generation using scheduled jobs
1. create a template
replace the table with your table and update template details
2. go to scheduled jobs and click on new and click on "Automatically generate something (a change, an incident, a ci, etc) from a template "
3. populate the detail and select the template that you have created in generate this field
You can follow this approach when you have to generate something with static values
coming to you requirement
1. are you sure you want to generate SC task alone without RITM and why, what is the business requirement
2. if you want to submit a catalog item weekly that also you can do using flow
use submit a catalog item request action and fill the necessary details
follow this approach for complete RITM process instead just creating a sctask
2. Requested For field is not available on the SC task it's available on Requested Item so your script won't set requested for value
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya