Query Related to Fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
req_item.addEncodedQuery( 'active=true^stateIN3,4,7,1300,200^request.u_request_type=ESP service catalog^cat_item.workflow=b10a719a1b14d9589e324197b04bcbe0' + '^NQ' + 'active=true^stateIN3,4,7,1300,200^cat_item.nameINESP - Request New Integration,Cisco Catalog Builder Pre Approval' );
I have executed this query in the fix script, and it functions correctly; however, due to the presence of repeated conditions, I attempted to use an OR condition, which did not yield the desired results. Is there an alternative method to apply this query without repeating conditions? My objective is to merge the two conditions listed below into a single query within the fix script.
1. 'active=true^stateIN3,4,7,1300,200^request.u_request_type=ESP service catalog^cat_item.workflow=b10a719a1b14d9589e324197b04bcbe0'
2. 'active=true^stateIN3,4,7,1300,200^cat_item.nameINESP - Request Catalog Builder'. Please assist me in optimizing this query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
try this
req_item.addEncodedQuery(
'active=true^stateIN3,4,7,1300,200^request.u_request_type=ESP service catalog^cat_item.workflow=b10a719a1b14d9589e324197b04bcbe0' +
'^NQ' +
'active=true^stateIN3,4,7,1300,200^cat_item.nameINESP - Request New Integration,Cisco Catalog Builder Pre Approval'
);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi Ankur,
Thank you for your prompt response. However, the same common query "active=true" and state='3.4,1300'
"is recurring here. Without that repetition, can we construct the query using an OR condition?
