Report that shows all Change Requests that are in Change Approval State before a certain day and time.

Ahmed Nadeem
Kilo Contributor

Our company is changing its Change Management process and they want to deadline to be during the week on Tuesday at 12:00pm. Those changes will be approved by the change manager on Wednesday at 2:00pm at the Change Management Meeting. It needs to be an automated report that shows all Changes Requests in that Approval State that meets the deadline and before.

The issue i am having is creating a report for the meeting that shows all changes that are in Pre-Approval state ready to be approved at the Change Meeting by the Change Admin. When i contacted ServiceNOW, they told me to use the "relative" field and do 26 hours before. The problem with that is if some one gets to Pre-Approval state at 12:15pm, during the meeting on Wednesday at 2:15pm the report will show that change too while the Change Admin is approving the Change and the report reloads. After explaining that to the ServiceNOW Engineer he first told me it can only be done manually. Then later he said i could do it if i write a script for it and run the report that way.

I have no idea what that script would look like and would really appreciate the help. I am fairly new to ServiceNOW and i am still learning.

1 ACCEPTED SOLUTION

I have attached a sample Script Include that is Client Callable, and the sample query that would always fetch the change requests between the last Tuesday after 12PM and this week's Tuesday 12PM.



URL would look like:


http://<instance_name>/change_request_list.do?sysparm_query=sys_created_on%3E%3Djavascript%3Anew%20DayDateTime().getLastWeekEndDateTime(2)%5Esys_created_on%3C%3Djavascript%3Anew DayDateTime().getCurrentWeekStartDateTime(2)



You can modify this query and use it for the reports.


View solution in original post

6 REPLIES 6

1. You can modify the query to achieve that:



http://<instance_name>/change_request_list.do?sysparm_query=sys_created_on%3C%3Djavascript%3Anew%20D...



2. Yes, you need to import the attached XML file. It will appear under the Script Includes module. You can edit it to suite your requirements.



Thanks,


Aditya.


Thank you. This worked for me.