Object-Oriented JavaScript in Our Stuff...
Many of the kinds of things y'all want to customize in Discovery (especially sensors and CI consolidation) involve some programming in JavaScript. Even if you're already familiar with JavaScript, you may run into something new when you look at our existing code for examples: object-oriented programming in JavaScript. Then on top of that, we've extended JavaScript a bit with a some things specific to Service-now.com.
There is lots of great material already available for object-oriented JavaScript. If you're seriously interested in becoming a JavaScript expert, I highly recommend JavaScript: the Definitive Guide, by David Flanagan. It's simply the best reference out there I've run into. Alternatively, here are some good starting points on the Intertubes: Douglas Crockford's excellent JavaScript essays, Mike Koss' text, and JavaScriptKit's tutorial.
But to learn about Service-now.com's extensions, read on...
You may already be familiar with script includes — but if not, navigate to Discovery Definition→Script Includes to see a list of them. If you drill into one (say, "DiscoveryStatus"), you'll see that it contains the JavaScript declaration of the DiscoveryStatus JavaScript class.
The key here is that the name of the script include matches (exactly) the name of the class declared within it. We've extended JavaScript to automagically include a script include whenever (a) a class is referenced that hasn't already been declared, and (b) there is a script include with exactly the same name as the class.For example, suppose you write the following script to execute on the server:
https://www.servicenow.com/community/in-other-news/object-oriented-javascript-in-our-stuff/ba-p/2288497