- 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-22-2017 10:46 PM
Hey Chris,
What about..
- a before business rule that applies to your catalog item, which sets the actual start/work start field to the variable 'Placement Time'.
- an SLA of 10 hours that applies to your catalog item & retroactively starts at the actual start field time
- Clone the provided default SLA workflow & configure it to notify at 80% & 100%
I would personally put it in it's own little table & make the form a record producer, so that you don't need to worry about a before business rule (and can keep any of the logic clearly separated from sc_ tables).
Cheers,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2017 12:29 PM
Thanks for your response Matt. I want to make sure I am understanding your first two points. So, are you saying that the before business rule would take the Placement Time and apply it to the "Set start to" filed on the retroactive start SLA? Or are you referring to a different field when you said start/work start field in the first bullet point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2017 10:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 07:24 AM
Anurag,
I'm looking at the columns on the sc_req_item table and do not see a column called Actual Start. Am I looking in the right table? Also, when I set the SLA to Retroactive State, the Set Start To field does not appear. I have a ticket in on HI for that issue, but if you have any ideas on this, I would appreciate your input.
Thanks,
Chris