- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:30 AM
Hi,
Could you please help me with background Script for below condition:
How to delete multiple sc_task with the help of task numbers e.g SCTASK0364621, SCTASK0364622, SCTASK0364623, SCTASK0364624, SCTASK0364625, SCTASK0364626, SCTASK0364627, SCTASK0364628 and so on...........
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:48 AM
@nishtha6 , whatever record you need to delete you can add under this query after IN,
numberINSCTASK0364621, SCTASK0364622, SCTASK0364623, SCTASK0364624, SCTASK0364625, SCTASK0364626, SCTASK0364627, SCTASK0364628
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:40 AM - edited 01-14-2024 09:45 AM
Hi @nishtha6
Try below background script:
var gr = new GlideRecord('sc_task');
gr.addEncodedQuery('numberINSCTASK0364621, SCTASK0364622, SCTASK0364623, SCTASK0364624, SCTASK0364625, SCTASK0364626, SCTASK0364627, SCTASK0364628');
gr.query();
while (gr.next()){
gr.deleteMultiple();
}
Please mark my answer helpful if it resolves your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:45 AM
Hi Jayant,
Thank you, i tried this but its deleting all sc task records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:48 AM
@nishtha6 , whatever record you need to delete you can add under this query after IN,
numberINSCTASK0364621, SCTASK0364622, SCTASK0364623, SCTASK0364624, SCTASK0364625, SCTASK0364626, SCTASK0364627, SCTASK0364628
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 09:50 AM
thank you, its working
