Professional Documents
Culture Documents
But when it comes to important pieces of code, their maintainability and efficiency become an important subject,
and some parameters may interfere such as;
Initial business need level of detail
Integrator experience with coding good practices and technical architecture
Multiple modifications of business needs
I wanted to show with a concrete use case an example of integration, done fast Firstly, and done correctly in the
second time (at least the best way possible to anticipate changes and facilitate maintainability).
Now, during the first testing phase your customer may come back to you saying the integration works well when
updating the incident from the form, but not when the Business Service is updated from the list.Also, it doesnt
work when an incident is created/updated by web services (for example through REST from a vendor managing
1
ServiceNow Advanced Scripting:...
the network incidents).You may want to fix this as fast as possible by creating the same script as a business
rule when Business Service changes and is not null.
1. Inconsistency; Your scripts may act differently and your rule would not work the same through client
interface and web service / automatic update.
2. Troubleshooting issue; your scripts may be bugged and you would have to check both.
3. Maintainability issue; You may need to update the rule (the requirement may change, a new impact
value may be added for example), then you would have to do it two times.
The API
First, you have to build your core business. To do so, you need to define what is the core of your business need.
In this example, we could say I need to set the impact from the Service criticality.The proper way to do it is to
centralize your business intelligence in a unique script include for a given group of developments; for example, a
script include per process is a simple way to clearly separate your code. This is your "API" for this process.
You can add an info message, which is just UX comfort; you notify the user of what happened and how.
2
ServiceNow Advanced Scripting:...
If you need to update the rule (for example, a new level impact 4 is added and you have to update your
mapping accordingly) you will only have to change it one time, in your API.
If the customer changes his mind and want to deactivate the client side (e.g for better performances), you just
have to deactivate the client script.
Tags: online, course, online training, online courses