Query for change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
My senior asked that he want query for change requests. Change requests are created on every Friday he will review all open change requests on Monday. I want a query for that. In addition can I create report for that query how to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hi @VenkataSreC ,
run the below script in the background script it'll give you the list of change numbers created on fridays
var changeNumbers =[]
var gr = new GlideRecord('change_request');
// gr.addEncodedQuery('Add your query if required example crated on this year')
gr.query();
while(gr.next()){
var chdate = gr.sys_created_on.getGlideObject()
if(chdate.getDayOfWeek()==5){
changeNumbers.push(gr.getValue('number'))
gs.print(gr.number + ' ' + chdate.getDayOfWeek()+ ' '+gr.sys_created_on)
}
}
gs.print(changeNumbers)
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
so what did you start with and where are you stuck?
it's an easy requirement.
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