- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 01:57 PM
I have an interesting process I would like to build out in ServiceNow, I am looking for some input on the best way to do this. I started building this out in a request/workflow setup, because requests/workflows and incidents are what I am most familiar with and it doesn't make sense to build this out in incidents since it's not a break/fix type situation. If there a better way to build this outside of the request process, I am certainly open to suggestions.
Here is our process. A 100 car train enters one of our facilities to be loaded. We need to load the train in 10 hours to avoid a penalty cost. I've built a simple request form that only has two variables, one of them called Placement Time that is a date/time variable to input the date and time the train arrived. So when a train arrives, a worker at the facility would enter the request and input a Placement Time. Once the request is submitted, which could be something like 15 minutes or so after the train arrived, I need to evaluate that Placement Time variable and determine how much time is left of our 10 hour window. We want notifications to be sent out when we are down to 2 hours and 0 hours to make the workers aware. So I need to be continually counting down the remaining time to ensure the notification go out exactly at the 2 and 0 hour times.
Thanks in advance for your input
Chris
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 04:04 PM
Hi Chris,
The 'Actual start' field's column name is actually 'work_start'. That being said, this will still work with a custom date/time column.
So, as an example, a before BR on insert, with a condition of the catalog item equaling the item you've created for this purpose, with the code being;
current.work_start = current.variables.placement_time;
Where 'placement_time' is the name of your variable.
Cheers,
Matt
EDIT: To your other query re SLA, you're using the field "Actual start" in the SLA record from the sc_req_item table (as you can't use variables I believe). This is in effect, using "Placement Time", as with the business rule mentioned above, you are ensuring that the "Actual start" field is equal to whatever the operator input into "Placement Time".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 10:21 AM
Anurag,
I figure out why the Set to Start field was not appearing, but still would like confirmation back on the Actual Start field on the RITM table. Not seeing that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 12:07 PM
Anurag,
I just ended up creating a new column on the sc_req_item table called Actual Start Time that now appears in the Set to Start drop down of my retroactive SLA. I created a before insert BR that runs the below script, but I am not able to get it to copy the Placement Time catalog variable to the Actual Start Time field. I've also used getDisplayValue at the end of the script, but again, it did not copy over. Scripting is not my strong point, so any assistance you could provide on this would be appreciated.
current.u_active_start_time = current.variables.placement_time();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 04:04 PM
Hi Chris,
The 'Actual start' field's column name is actually 'work_start'. That being said, this will still work with a custom date/time column.
So, as an example, a before BR on insert, with a condition of the catalog item equaling the item you've created for this purpose, with the code being;
current.work_start = current.variables.placement_time;
Where 'placement_time' is the name of your variable.
Cheers,
Matt
EDIT: To your other query re SLA, you're using the field "Actual start" in the SLA record from the sc_req_item table (as you can't use variables I believe). This is in effect, using "Placement Time", as with the business rule mentioned above, you are ensuring that the "Actual start" field is equal to whatever the operator input into "Placement Time".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 11:16 AM
I appreciate the assistance. I was able to get this working. Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 01:57 PM
Matt
The business had made a change to the requirements. They requested a new date/time variable on the request form called Release Time (release_time) and want the notification to be sent 5 hours prior to the Release Time. I also set up a timer in the SLA workflow that looks at the SLA's Breach Time (planned_end_time) and triggers the notification 5 hours prior to that. It is possible to take the request forms Release Time and copy it to the SLA's Breach Time that the workflows timer is watching? The Release Time is in essence the Breach Time