Write a script to display inactive problems with p2 incidents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 07:41 PM
Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 10:45 PM
Hi,
why to use GlideRecord in client script?
GlideRecord in client side is not recommended.
I believe this is not an actual business requirement from your customer
If you still require here is the updated script
var arr = [];
var gr = new GlideRecord('problem');
gr.addQuery("active", false);
gr.addQuery('state',4);
gr.query();
while(gr.next()){
var r = new GlideRecord('incident');
r.addQuery("problem_id", gr.sys_id);
r.addQuery('priority',2);
r.query();
while(r.next()){
arr.push(gr.number.toString());
}
}
alert(arr);
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2022 12:43 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2022 11:45 PM
Hii
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:08 AM
Hi,
share your script and where have you written it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:28 AM