I want to delete the records in incident table whose state is set to closed complete state
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:54 AM
Hi I have a requirement to delete all the records which are set to close complete state in incident table using scripting
can anyone help me with the code .
Labels:
- Labels:
-
Knowledge Management
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 04:45 AM
Hi,
Please create a fix script and run the script
var inc = new GlideRecord('incident');
inc.addQuery('state','')//add value of closed complete
inc.query();
inc.deleteMultiple();
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain
Regards,
Piyush Sain
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 07:54 AM
Hi, Delete the record is not advisable. You can set active true to false and disable the visibility.
Regards,
Suresh.
Suresh.