Leverage Studio's Source Control for Global Scope

markmmiller09
Kilo Expert

Studio's Source Control is an AMAZING feature, for scoped applications..... -_-

Has anyone figured out a way to use version control on the global scope?

In the Scripted REST APIs, I believe I've found the REST calls Studio is using in the VCS record, however it's private... surprise surprise. Any way I can leverage these calls or does anyone know of a custom app out there? I'm looking to push/pull global code from a Git repo hosted on GitHub.

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Mark,



The main reason Source Control is not available for global scope is because it can potentially leave your instance unusable.



Consider the case of getting the property "instance_id" or "instance_name" in source control, then someone creates a branch and switches branches. The properties are deleted from the system before bring brought back in from the new branch.



If you delete certain global proeprties, scripts, etc. your system can be left in an unusable state - unable to retrieve the contents from the new branch.



Too high of risk, so source control is not available for global.


Shahed Shah1
Tera Guru

Hi Mark,



I was thinking along the lines of this not too long ago and dug in to those REST calls that I saw happening in the background. Admittedly I wasn't think of relation to Git access but taking this functionality and making it URL driven so you can easily call it.



After some digging and tinkering, I was able to hack together a sample and uploaded it to the Share: Code Search Portal Widget. Since it's a sample, you're more than welcome to take the code and have fun with it.



However, I would refer to Chuck's caution so that you ensure to maintain your scope and integrity of the instance. So, I'd like to re-iterate that this code is just to serve as a sample and not fit for production usage.



Regards


Shahid


The SN Nerd
Giga Sage
Giga Sage

I would like to see support for Global Applications in the future.

I don't think it would necessarily break an instance if the following rules and features were included:

-Global Applications only, no ad-hoc work or update sets

-No OOTB files cannot be included, only new files related to the application

-Cannot commit to a lower version than the version the code was built on ServiceNow (just to be safe) OR built-in dependency checking on a version based on core platform usage.

I understand this would be a lot trickier than scoped apps, but I don't think it is impossible and would be a great feature to see in the future. 


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

I believe this is coming in Paris (Safe Harbor) 


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022