How to delete comment or work notes from an incident task using Table API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2025 12:37 AM
Hi,
I just started working with Servicenow. I have tried to find a easy way to delete a specific comment or work note from an incident via the Table API. I want to delete a comment using the comment ID/work note ID (sys_id) with the Table API from all tables needed. From what I understand there is three tables that I need to handle?
sys_journal_field sys_audit sys_history_set
The problem is that the sys_id is different in all tables and there is really no way of making sure that I delete the correct items? My code will have the incident sys_id and the comment/work note sys_id available when doing this operations. What is the best way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 11:44 PM
Hi again,
Yes I have read that article before and my need was to do this programmatically via REST API. I will discuss with my team how to proceed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 02:27 PM
Hi @ellinorM
You already have expert @Brian Lancaster on this case, and i would like add my point. In my previous project we also delete the comments once added via going in logs , but doing with api is not that easy.
Manually it take 5 to 7 mins to delete one comment.
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
01-13-2025 12:02 AM
Thank you for your input. It's not an option to do this manually for us with the business modell we have today. If we are going to keep deleting comments we need to do this via the API without manual action. But since this is not an easy operation in Servicenow I will discuss with my team if we can change the business logic instead and remove the need of deleting comments. But thanks for you input!