Is it possible to set the application scope and update set during a REST call?

danmorella
Kilo Contributor

I am trying to update certain application files like UI pages and CSS scripts via the REST API.   Currently if I login to the ServiceNow interface as the user making the REST call and change the application scope and update set the REST call will apply to the correct scope and set.

But in order to accommodate multiple developers using the same build process (only one REST user for everyone), I would like to set the application scope and update set during the REST call depending on which files are being updated.

Is this possible?   If so, how?  

If not, are there alternative methods for setting the application scope and update set for a specific user without having to login to the ServiceNow interface manually?

7 REPLIES 7

Mike Allen
Mega Sage

It looks like there is a User Preference for this:



find_real_file.png



You could make a REST call to preferences and specify the update set (and likely the application) there.


Chuck Tomasi
Tera Patron

Hi Daniel,



This is the first I have heard of anyone using the REST API to make configuration changes in the way you propose. I don't believe it was intended for that. It's main use was to interact with the meta data (incidents, change requests, CMDB, and other data.)



Can you give me some more insight as to your use case for wanting/needing to change the configuration records outside of ServiceNow?


We are trying to implement a UI development process that does not require the developer to have any understanding or interaction with ServiceNow.   There are a number of advantages that we see to doing this.   First, UI developers can use the tools they are familiar with and test/debug the application before ever deploying to ServiceNow.   Second, we are able to minify and consolidate the html/javascript/css before writing to ServiceNow.   This leads to a reduced number of server calls and bandwidth for end users on mobile devices when consuming the content, which we have noticed is a problem (even via desktop connections).   It also allows us to use Git as Git is intended to be used.   We are able to submit changes of individual files which can be version controlled, analyzed by automated tools, and then code reviewed before being merged to the appropriate branch and deployed to ServiceNow through Jenkins.



In the short time we have been using this process, it has worked well.   There was even a CreatorCon session where someone else was doing the same thing using Grunt and NodeJS rather than Git and Jenkins.   Porting HTML5 applications to ServiceNow.



However, although we want to deploy to our development environment using this methodology, we would like to follow a more standardized process when moving applications from environment to environment (dev->QA->production).   We have verified that changes via the API do get saved to the application and the update set correctly.   However we don't want to login and manually change those values each time we try to deploy to ServiceNow but rather make the changes via the REST API so it can be automated based on what is being deployed.


Thank you. I have forwarded the link to this thread to our product manager.