<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[ServiceNow Development - Medium]]></title>
        <description><![CDATA[ServiceNow is an ITSM Platform. We write about how to build applications and properly manage code on the ServiceNow Platform. We’ll recommend what to do, and what NOT to do. We aim at giving our end users the best user experience possible. - Medium]]></description>
        <link>https://medium.com/servicenow-development?source=rss----4e187d6422c8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ServiceNow Development - Medium</title>
            <link>https://medium.com/servicenow-development?source=rss----4e187d6422c8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:30:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/servicenow-development" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Only Software Development Lifecycle in ServiceNow]]></title>
            <link>https://medium.com/servicenow-development/the-only-software-development-lifecycle-in-servicenow-8604e040d83f?source=rss----4e187d6422c8---4</link>
            <guid isPermaLink="false">https://medium.com/p/8604e040d83f</guid>
            <category><![CDATA[xml]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[servicenow-training]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[itil]]></category>
            <dc:creator><![CDATA[Louis Waller]]></dc:creator>
            <pubDate>Sun, 11 Oct 2020 19:52:03 GMT</pubDate>
            <atom:updated>2020-10-11T19:52:03.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9o0OkpFyYpl9klL7" /><figcaption>Photo by <a href="https://unsplash.com/@youxventures?utm_source=medium&amp;utm_medium=referral">You X Ventures</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><em>Note: This article covers how update sets work and how they should be managed across different ServiceNow environments. This is aimed at newer ServiceNow Admins or those who have lost their way.</em></blockquote><h3>Update Sets</h3><p>As an Admin, you need to start working in “Update Sets” (if you’re not already).</p><p>It should go without saying, but don’t make changes directly in production, I see this way too frequently.</p><blockquote>Every enhancement belongs in an update set.</blockquote><p>Update sets at their very core are just XML files (even something as small as modifying a form.) An update set is a simple data structure where you can capture changes in one ServiceNow instance, and easily move them to another instance. ServiceNow has a built in feature to pull update sets from one instance to another. You can similarly very easily export an XML file of Incidents (or any other data) and import that XML file into another environment.</p><p>You should never, for example, be modifying records like ACL’s or scripts in production, even if you know what you’re doing. It’s simply bad practice. If you do, then you’ll have a mismatch between records in production and sub production. So the next time you go and update records in sub production in an update set, you’re just going to writing over the work done in production. <strong>See how confusing that can be?</strong> The easiest way to not put yourself in that situation is to always use an update set.</p><p>It’s important to understand what gets caught in an update set, and what doesn’t. This is a difficult concept for some to grasp, but it’s worth the time.</p><p><strong>What’s Captured</strong>:</p><ul><li>All Enhancements (UI Policy, ACL, Business Rule, Client Script, Script Include, UI Page, UI Actions, Widgets, etc.) Any changes to these records are captured in an update set.</li></ul><p><strong>What’s Not Captured</strong>:</p><ul><li>Data (As in records created on tables, for example — an incident)</li><li>Scheduled Jobs</li></ul><p>After you create an Update Set, and make it your “current” update set, the ServiceNow platform will now begin tracking all of your customizations.</p><p>The “Default” update set should always be on in the background, when you’re not developing. So it’s either the update set you’re currently working from, and when you’re not actively working it, always turn on the “Default” update set.</p><p>I worked with a client once and they turned the Default update set off — big mistake.</p><p>Once an update set is promoted to another instance, it first needs to be previewed and then committed. The Preview process reviews the configuration for any conflicts. A common conflict that’s seen is one where you have an update in the target instance that wasn’t captured in the source. If you know that your update set is valid, you can either choose to Accept the Remote Update or Reject it. Rejecting it will skip the customization all together.</p><h4>The “Admin” Role</h4><p>The ‘admin’ role is every single role in the ServiceNow environment, wrapped into one.</p><p>The only users at any given company that deserve this role are the ServiceNow Admins, that are performing actual ServiceNow Development work. IT Management doesn’t need admin either. You will have entitled people in IT that will make the claim that they need the role, but they don’t. Be incredibly careful about allocating this role out.</p><p>Users with the admin role have access to every table in the system (unless a scoped application defines that ‘admin’ should not have access. For example: HR Case Management Admins can say, the system “admin” role can or cannot have access to HR Cases. The same goes for all other scoped applications.)</p><p>This means they can delete all of your incident records, with a single line of code.</p><p>It’s a recipe for disaster and most companies probably have far too many users with “admin”.</p><h4>Security Admin</h4><p>The “security_admin” role is similar, but different. Security Admin allows you to update ACL’s and Security Rules and access certain logging tables. All users with “admin” should likely have “security_admin”, unless you have a clear use case to the contrary.</p><p>If you’re updating ACL’s, this is a requirement. Also worth mentioning that you need to have security admin, to give security admin.</p><h3>ServiceNow Environments</h3><p>Every ServiceNow Team needs at a minimum, 3 ServiceNow instances (You can probably get by with 2, but you’ll run into issues more frequently.)</p><p>One should be a Development instance.</p><p>Next you have your Test instance.</p><p>And finally, obviously, you will have a Production instance.</p><h3>The Development Instance</h3><p>As a ServiceNow Admin, I spend most of my time in this environment.</p><p>Don’t make the same mistake as many other companies.</p><p>ServiceNow was designed to make it super simple to build enhancements and promote them to other instances. Don’t have your end users or testers run any tests in development. While it’s possible, and your manager probably won’t even realize it’s happening, it’s just bad practice. Development is where you, the admin or developer, should be “building” out your enhancements and applications. And nothing else.</p><p>The development environment is obviously still a “junior test ground”, but for ServiceNow Admins only. Meaning, once you build out an enhancement, you’re obviously going to engage in some testing yourself to validate that it worked. But don’t get sloppy here, once you’ve confirmed that it works, it’s then time to push up to Test. Don’t invite your testers into Development.</p><h3>The Test Instance</h3><p>The test instance is all about your end users that are going to be testing your enhancements.</p><p>Once you’ve moved your update sets successfully to test, you can then direct your testers to login here and engage in rounds of testing. This is probably the least frequently used environment, but it’s a crucial step in the development lifecycle.</p><p>Your testers are going to expect that they’ll have the same exact experience in test as they will in production. This is your opportunity to give them that preview of what it will be like.</p><p>It’s important to document your testing. It’s easy to be nonchalant and sort of let this step go. Most people will just send a Slack message and say “Great work, move it up to production whenever.”</p><p>Which in theory sounds fine, but again, this is sloppy and bad practice. Documentation is an important supporting attribute to the testing process.</p><p>Proper documentation is really a CYA (Cover Your Ass) activity and will help to protect you in the future. If someone were to say, when or why did this happen, you can point them to the documentation and the sign off of the enhancement requesting team. You won’t get burnt this way.</p><p>Even if it’s just a simple Google Document where you briefly outline what’s been done, and your tester signs off on it.</p><h4>Create A Change Request</h4><p>This is another great way to provide documentation for work that you’re performing in the ServiceNow environment.</p><p>For all of your ServiceNow related enhancements, if you just create a quick Routine change, which doesn’t require CAB approval, you’re setting yourself up for success.</p><p>A Change Request or Documentation external to ServiceNow are both acceptable ways to track the work you’re pushing up to production.</p><h3>The Production Instance</h3><p>This is where all the magic happens.</p><p>Once an update set has been pushed to Test, the testers have confirmed that the new enhancement(s) are working as expected, you then finally push the update set to Production.</p><h4>IT Change Windows</h4><p>Some companies have these, and others don’t. It’s a window that’s defined by the Change Advisory Board (CAB), about when code can be pushed to production, and when it can’t.</p><p>Ideally, you’ll have an IT Change Window once a week, where you will push you code up to production. This way, you’re not expected to just push it randomly whenever something comes up.</p><p>A regular cadence will assist with your development and it will help to manage expectations on the side of the requesters.</p><h3>Downclones and Software Upgrades</h3><p>These two processes often work in tandem with one another.</p><p>Quarterly, or at least twice a year — you should be processing downclones of your ServiceNow data.</p><p>This means, taking production and cloning it over your sub production environments. This is a way to “true up” your data and keep everything in sync with one another.</p><p>Over time, small changes occur in production, and by down cloning, you ensure that you’re building in an environment that is similar to production.</p><p>Whenever you have an upgrade on the horizon, you should think about doing the following:</p><ul><li>Downcloning Production over Sub Production instances</li><li>Upgrading Sub Production instances only (don’t do all at the same time)</li><li>Test the software upgrade in sub production, make sure ALL teams that use production are testing.</li><li>Only then, once approval and proper communications have gone out, do you schedule production to be upgraded.</li></ul><p>Do you have any sensitive data in your ServiceNow environment? Maybe your company uses HR Case Management or Security Incident Management — just 2 examples of data that would be considered sensitive in nature. Most people on these teams don’t fully comprehend what the ServiceNow software development lifecycle looks like. They just see ServiceNow as a ticketing system, and even if you run a downclone, they still probably don’t realize that you’re taking all of their production data and moving it to an instance that’s not managed by them. Thus creating a security vulnerability.</p><p><strong>Most teams focus on Production only, but security needs to be extended to sub-production instances as well. The best way to manage this is to control the data in these sub-production environments. Which means leaving out any sensitive data.</strong></p><p>In this scenario, you will need to “Exclude Tables” in your next production down clone, on both the Target and Source instance for this to work properly.</p><p>You could always just write a background script to delete the data, post clone, but why not learn how to do it the right way?</p><p>By now, I hope to have convinced you to work in update sets and to never modify anything in production.</p><p>As you continue to grow from an Admin to a Developer in ServiceNow, you will become more comfortable with these concepts.</p><p><em>This article was created to help those that are starting out, if you’ve got several years of ServiceNow experience, I don’t think any of this will be new to you, but I also don’t think you would have finished the article either!</em></p><p><strong>Be well and build great things!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8604e040d83f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/servicenow-development/the-only-software-development-lifecycle-in-servicenow-8604e040d83f">The Only Software Development Lifecycle in ServiceNow</a> was originally published in <a href="https://medium.com/servicenow-development">ServiceNow Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easily Bulk Update Tickets in ServiceNow — Use a Background Script]]></title>
            <link>https://medium.com/servicenow-development/easily-bulk-update-tickets-in-servicenow-use-a-background-script-d465f2c10927?source=rss----4e187d6422c8---4</link>
            <guid isPermaLink="false">https://medium.com/p/d465f2c10927</guid>
            <category><![CDATA[itil]]></category>
            <category><![CDATA[servicenow-training]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[itsm]]></category>
            <dc:creator><![CDATA[Louis Waller]]></dc:creator>
            <pubDate>Sat, 10 Oct 2020 17:51:41 GMT</pubDate>
            <atom:updated>2020-10-06T17:01:28.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>Easily Bulk Update Tickets in ServiceNow — Use a Background Script</h3><figure><img alt="servicenow background query javascript update incidents in bulk" src="https://cdn-images-1.medium.com/max/901/1*W_NNjBwh_TT9wTF2RDNBSQ.png" /></figure><p><em>Disclaimer: Running a background script is a server side operation and should be done under the supervision of your ServiceNow Admin. Background scripts should be run in a sub production environment before being executed in Production.</em></p><p>There comes a time in every ServiceNow Admins career where records on a certain table get stale and need to be cleaned up or closed out. This action is a bit difficult to perform in the List View, which is where the Background Script functionality comes in handy. In my nearly 8 years as a ServiceNow Professional, the background script functionality has proven to be extremely helpful with running bulk operations and updates.</p><p>I will highlight how to perform this action in a few easy steps using the Background Script functionality in ServiceNow. This is a small piece of JavaScript code that finds certain records and performs an action on these records (Adding a work note, updating the state, etc.)</p><p>First, navigate to the Background Script module in ServiceNow. This is an area that is only accessible to users with the ‘admin’ role, by default. You can get here by typing “background” in the Application Navigator (System Definition &gt; Scripts — Background)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gr_-U_HfHHY3_Kk7eHSzSw.png" /></figure><p>Next, you will begin writing your GlideRecord Query. This action, at it’s simplest level, runs a query against any table in ServiceNow and then allows you to perform an operation, usually an Update, on the records found. For example, the query used in this example will be to find ALL incidents that are over a year old and that are also State=On Hold.</p><blockquote>I use the <a href="https://www.jetbrains.com/webstorm/">JetBrains WebStorm</a> JavaScript Editor for all of my ServiceNow Development work. I find the native code editor to be quite bad for writing code.</blockquote><p>Below is the background script to run, pay attention to the comments in blue that indicate what action the below line is performing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*W_NNjBwh_TT9wTF2RDNBSQ.png" /></figure><p>In this simple scenario, we’re using the addEncodedQuery() method of the GlideRecord class. This method can prove to be very useful if you have many conditions that you want to account for.</p><p>To build out an encoded query, navigate to the list view of the table in question and start building out your conditions using the condition builder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*_EFhReMepM1x7UJkgq8g0w.png" /></figure><p>So we are now showing a list of records that were BOTH created before 1 year ago AND the state is “On Hold”.</p><p>Once the conditions have been created, you can right click on the teal/green condition and go to “Copy query”. This query is what we will use in Line 4 above to tell ServiceNow which records to display in our query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*e20tcYuvsezbFmdgik8Ukg.png" /></figure><p>Now that we have decided on the records to perform an action on, we then need to decide on what we’re going to do with the records that are returned. In this example, we’re simply adding a “Work note” in case someone comes back later and wants to know why this record was closed out and we’re also changing the state to “Closed”, or 7. <strong>ServiceNow state field values are stored on the “sys_choice” table and typically reference a numeric value, even though the display value is Closed. Check your “sys_choice” table first before running this action in your own instance.</strong></p><p>We then run a couple of lines that deserve some attention:</p><pre><em>// Does not update System Fields<br>inc</em>.autoSysFields(false);</pre><p>This line makes sure that the “Updated” field and other System Time Fields are not updated. So when the query is completed, this record will not be shown as being updated today, which would be a little confusing for such an old incident.</p><pre><em>// Does not execute any Business Rules<br>inc</em>.setWorkflow(false);</pre><p>This line makes sure that other business rules are not executed. This is helpful so we don’t trigger other operations in the platform which might cause confusion for users.</p><pre><em>// Updates the record in question<br>inc</em>.update();</pre><p>Finally, this line is the most important line in the entire script. This line actually forces the update on the record in question. Without this line, the incident will not be updated and nothing would happen. It is executed for each record returned in the query.</p><p>Note: After running your background script, you may get an error that certain mandatory fields are not populated! If so, copy the syntax in the while loop at update the fields in question.</p><p>Thanks for taking the time to read through my article! If you have any questions, please add a comment and I’ll be sure to answer it.</p><p>Script is below for reference:</p><pre><em>// Build Query<br></em>var <em>inc </em>= new GlideRecord(“incident”);<br><em>// Use an Encoded Query<br>inc</em>.addEncodedQuery(“sys_created_on&lt;javascript:gs.beginningOfOneYearAgo()^state=3”);<br><em>// Execute the query<br>inc</em>.query();</pre><pre><em>// Print the number of records that will be updated<br></em>gs.print(<em>inc</em>.getRowCount() + “ records were found.”);</pre><pre><em>// Run a while loop and interate through the records found<br></em>while (<em>inc</em>.next()) {</pre><pre><em>// The inc object can be used to update columns on the table<br> inc</em>.work_notes = “Auto closing all incidents over a year old that are currently on hold”;<br> <em>inc</em>.state = 7;</pre><pre><em>// Does not update System Fields<br> inc</em>.autoSysFields(false);</pre><pre><em>// Does not execute any Business Rules<br> inc</em>.setWorkflow(false);</pre><pre><em>// Updates the record in question<br> inc</em>.update();</pre><pre>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d465f2c10927" width="1" height="1" alt=""><hr><p><a href="https://medium.com/servicenow-development/easily-bulk-update-tickets-in-servicenow-use-a-background-script-d465f2c10927">Easily Bulk Update Tickets in ServiceNow — Use a Background Script</a> was originally published in <a href="https://medium.com/servicenow-development">ServiceNow Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The One Trick Most ServiceNow Admins Don’t Know]]></title>
            <link>https://medium.com/servicenow-development/the-one-trick-most-servicenow-admins-dont-know-1921bb147ded?source=rss----4e187d6422c8---4</link>
            <guid isPermaLink="false">https://medium.com/p/1921bb147ded</guid>
            <category><![CDATA[itil]]></category>
            <category><![CDATA[glide-record]]></category>
            <category><![CDATA[servicenow-training]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Louis Waller]]></dc:creator>
            <pubDate>Sat, 10 Oct 2020 17:51:08 GMT</pubDate>
            <atom:updated>2020-10-06T17:26:05.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="servicenow-client-side-javascript-editor-incident-form" src="https://cdn-images-1.medium.com/max/1024/1*RfT9emHEEPeVGOl5VzsUZw.png" /></figure><p>Most ServiceNow Admins have a solid grasp on the difference between Client side and Server side scripting in the platform (if not, time to hit the ServiceNow Docs!).</p><p>In my time at ServiceNow, as a Consultant, I would frequently run into scenarios where I’d have to change a single value on a form, but the field was being controlled by a UI Policy Action or other Client Script that prevented me from allowing an update.</p><p>So instead of having to dig into the UI Policy Actions and Client Scripts, we can spin up a client side editor in seconds and quickly make the change. This will prove to be a huge time saver if you’re managing the ServiceNow Platform. Keep in mind, this is client side only, so no using the current object or running queries (bad practice).</p><p>Instead, you can use the g_form library and perform an undetermined amount of different actions and behaviors. As this is an action on the client side — only you are going to be seeing this field as being writable. So if you do this in production, the script execution only occurs locally on your own browser. If there was another user looking at the form at the exact same time, it would still be read only. When you make the change to the field and ‘save’ the record, the field update will propagate globally in the system and others will then see the new field change value.</p><h3>Introducing the Client Side Editor</h3><p>Pressing (Shift + Control + J on a Mac) will bring up the Client Side Javascript Executor panel.</p><p>This allows you to very easily run and execute client side JavaScript in ServiceNow. This feature is restricted to users with the ‘admin’ role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfT9emHEEPeVGOl5VzsUZw.png" /></figure><p>For this example, we will make an update to a field that is already “Read Only”, which is controlled by an existing UI Policy Action. To override this action on the client, we simply need to create a script to make it editable.</p><p>So we will simply type a client side command to allow us to write to the field, as follows:</p><pre>g_form.setReadonly(&quot;short_description&quot;, false);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1FbRUlB_OYDwyBRz8jaAg.png" /></figure><p>As soon as we execute this command, we can see the the “Short description” field becomes writable and we can then make an update to the field and save the record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdlHUuVglFW4V_QRocJrug.png" /></figure><p>Now that the field is writable, all you have to do is make the change to the field and update the record.</p><p>As soon as you save/update the form, the previous features will become active again and the field will be read only.</p><p>The goal here is truly to save time. You could go hunting for the control that is making the field read only in the first place and turn it off, but that’s guaranteed to take more time than this easy method.</p><p><strong>This is something that surprisingly few ServiceNow Admins are familiar with and is a feature that should be used more frequently!</strong> Give it a shot in your instance and let me know if you find it helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1921bb147ded" width="1" height="1" alt=""><hr><p><a href="https://medium.com/servicenow-development/the-one-trick-most-servicenow-admins-dont-know-1921bb147ded">The One Trick Most ServiceNow Admins Don’t Know</a> was originally published in <a href="https://medium.com/servicenow-development">ServiceNow Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>