
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-04-2020 03:09 PM
Is it just me, or are Update Sets kind of a pain in the posterior? Sure, at first they seem convenient in the way they magically record what you change so you can apply them to your other instances. But the more I use them, and the bigger my team gets, the longer my list of grievances against them grows. This post is about just one of my gripes. But lest you think I'm here just to complain, know that I offer a (partial) solution as well.
Traditional code source control typically offers the ability to lock code and other virtual objects in a way that encourages no more than one developer to work on them at a time. That way, if Jack is working on a form layout and Jill attempts to change the same view, Jill will have to wait until Jack is done. Nobody tumbles down, and everyone's crown remains intact.
Some source control systems also allow branching of code, which is an explicit exercise in allowing multiple versions. Once a branch is formed, there are only 3 possible outcomes: 1. it is eventually carefully merged back into the main line of code, 2. it becomes a permanent alternate version, or 3. it is abandoned.
Update Sets, in contrast, allow multiple people to work on the same objects with no requirement nor even warning that someone else may have pending changes. Further, and scarier, update sets store a version of the objects that have changed, essentially automatically and transparently creating branches.
Egad.
ServiceNow is, to their credit, slowly embracing source control. But to date, it can only be used from Studio, which can only be used for scoped (not global) applications. In addition, I don't believe there is any way currently nor in their safe harbor statements to truly lock objects from being modified outside the scope of the studio/Git integration. So, until they offer a better solution, here is something I've put together to help my team, and I hope you will find it useful as well.
This does not stop someone from creating branched versions of code, but it at least helps developers and release managers clearly see when it's happening.
Side note: my first attempt at this was to put an insert business rule directly on sys_update_xml to print a addInfoMessage immediately when an object already is in an "open" update set. It seems that business rules are not run by the subsystem that records changes to update sets, so that did not work out. Until someone smarter unlocks that option, this is my workaround.
The messages in these screenshots come from the attached code and are based on comparing the current update set to all other update sets that are not in an Ignore state, and have no Release Date. This is my team's definition of "open" (as in not yet released). Yours may differ and you can change the code accordingly.
The update sets are named to indicate which was created first, and, in theory, which should be released first. Note that the error message indicates an issue with this sequence. The object in both update sets is a business rule called "Clear On Hold Reason."
As you can see, the first update set indicates that the second contains a version of the object. However, since it's last update date is earlier than the one in FirstOne, the message is purely informational. The message in SecondOne is more dire. It indicates that FirstOne contains an update to the object that is more recent than the one it contains. This means that if we were to release these in a sequence of FirstOne and then SecondOne, the change in FirstOne would be reverted to whatever is in SecondOne.
Before you point out that we get similar messages when committing update sets, note that this message comes early enough to intervene. In this example, I would be inclined to force the current version of the object into SecondOne to make sure that the last update set deployed contains all the changes from both update sets. It's not nearly a perfect solution, but when life gives you lemons, put on a lemon smile!
Update set attached. To load, navigate to System Update Sets > Update Sets to Commit. Then click Import Update Set from XML. Open the imported update set, preview (please do review the code) and then commit. If you're in a domain separated instance, make sure you're in the global domain.
- 1,803 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I definitely understand the struggle... compared to Git, Update Sets feel like trying to write code on a stone tablet! I've spent more time than I'm willing to admit grappling with similar stopgaps.
Have you considered the Team Development feature as an alternative? Team Development was the "answer" SNOW tried to push out before shifting gears to Scoped Apps + Git. Instead of capturing changes into buckets, you instead flag files that are in your change at the time of pushing. This essentially turns each SNOW instance into a sort of... grotesquely shared VC branch. (I guess the best analogy would be having everyone work out of the same git repo... via FTP)
Team Development still doesn't let you compartmentalize changes within the same application file, but, at the very least, you know exactly what's going into a specific push because you're forced to review each application file before marking it as part of your changes.
If only PDIs actually supported Team Development... then you could have each team member working in their own environment and pushing the changes to a "master" development server! (definitely not happening now that they're choking Global scope stuff off!)
Alternatively, there's this handy open source project called sn-cicd that attempts to alleviate the issue by Frankensteining update sets into a real, genuine Git workflow. I've had... mixed results and the required setup is definitely extensive. I'd still say it's worth a try if you have the man hours, since you would be transfering lots of the difficult-to-awful stuff (automated testing / code review / version history) to Git and CI tooling.
It's unfortunate that the new, official, CICD stuff in Orlando explicitly does not support Global scope... It would have been such a perfect solution if they weren't implicitly forcing you to circumvent it whenever Global scope rears its ugly head!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Very interesting feedback. I'd googled a bit specifically for an open source project along these lines and did not find sn-cicd. But I was looking for simple source control and not the whole CICD enchilada. I'm going to read up on this project and see if we can make it fit. At first glance, and as you've hinted, it appears complex (e.g. costly) to setup and maintain.
From what I've seen of Team Development, it's designed around an assumption that every developer has their own instance. That may work for some environments, but presents significant headwinds for a complex domain separated MSP environment (disclosure, I work in a complex domain separated MSP environment). Like with scoped apps, the intent appears to be more app focused than IT operations focused. I love me some apps. In fact the attached is an app, but many things must still be done in global, or worse, across multiple apps (how, oh how ServiceNow is a developer supposed to coherently use Studio when a feature change spans 2-3 application scopes?). The stories I could tell about CSM...
In any case, I don't intend to naysay any of your suggestions as they're very helpful, and you've clearly been far down roads I've only seen on a map. Thank you for helping us all understand our options a little better.