- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 12:41 AM
Hi @Khanna Ji ,
One way to achieve this is to use the ServiceNow Import Set Table API. You can create a CSV file with the necessary data for each record (incident, incident task, and patch task), and then use the Import Set Table API to upload the data in bulk.
Here are the high-level steps:
- Create a CSV file with columns for incident short description, incident task short description, CI name, and patch task short description.
- Use the Import Set Table API to create an import set table for each of the three tables (incident, incident task, patch task).
- Upload the CSV file to the corresponding import set table using the Import Set Row API. This will create records in the import set table.
- Use a script to transform the data in the import set table and create the necessary records in the incident, incident task, and patch task tables. This script can run automatically when records are uploaded to the import set table using the Business Rule script.
In the script, you can use GlideRecord to create new records in the incident, incident task, and patch task tables. You can set the values for the short description, CI, and other fields based on the data in the import set table. You can also use GlideRecord to set the parent-child relationships between the records.
Once the records are created, you can use the sys_id values to link the incident, incident task, and patch task records together using GlideRecord.
Also, refer Import Set API and Import Set - API (blog-post)
Thanks,
Ratnakar