Could not update record through Rest API explorer .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2025 02:12 AM
Hi All,
I am getting 422 service error while using PUT method on Rest API explorer for incident table.
I have the below script in Scripted REST Resource table for the API definition. What should I make changes to get 200 success response to update the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:30 PM
did you requirement change and you don't want this validation?
if( source != 'SPAM Submission' && source != 'Application monitoring' &&ci.indexOf('Elastic')<0&&scope =='Yes'){
if((gr.subcategory != 'Domain Impersonation' ) && (gr.category != 'Malicious Code' && gr.subcategory != 'Malicious Attachment') && (gr.category != 'Unauthorized Access')) {
If yes then remove hose IF lines and simply allow the update to happen
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:39 PM
I think there is contradiction between 2 if conditions but I want both conditions to meet . Could you please help me to fix it ?
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:42 PM
please discuss with your customer what's the exact requirement and then fix by adding/removing the IF conditions.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader