How I Ditched Update Sets for GitHub in ServiceNow
[Music] hey everyone it's justin thanks for watching in this video i'm going to talk about how i stopped using update sets and now just use source control in fact i use github um i'm not sure if mine's exactly the right way to do it i'm just going to show you what i do from my day day-to-day to make sure my updates or my changes are kind of containerized and i can move them between instances at my job i have several instances i have access to i have my pdi and sometimes i want to do something dangerous in my pdi to make sure it works and then maybe move it into work for a demo or something else like that and we used to do that using update sets but i stopped doing that and now i just use github so let's get to it let's show you what's going on first thing i'm going to do is create a repository over in github so um you don't have to use github you can use your repository your code storage of choice i'm just going to do github because that's what i've been using and i'm just going to give it a name we'll just call this awesome app and apparently that's available yep so awesome app is going to be the name of my app and it's going to have a dash in it right here and this is going to be important when i actually set up my um my my application and service now i don't want this to be public i want to be private but if you are wanting to share something on the community forum or with your colleagues or maybe a colleague across the you know country or something like that you can definitely make them public i think with a github free license you're limited to the amount of public ones i'm gonna make mine private and that's pretty much it i'm just going to create the repo and i'm done and we called it awesome app so let's hop over to service now in service now we have our application picker at the top you can navigate over to the list view of the applications and create your app from there i like to do it this way just to get started really fast because i don't need to go into studio for everything i need we're going to go into studio to set up source control but um this is where i usually start and i wanted to keep it authentic i'm going to start from scratch i just hit create there and we're gonna give the app a name we'll call it awesome app uh so we can do the same here and uh we'll just uh i'm actually gonna put um capital letters on this just for the demo so we'll call this awesome app like this and i'm going to leave the scope alone we'll create that and then click ok that's going to create the app and service now i could click edit it's going to take me into studio which is where i want to be because i want to set up source control so this is something we can do here if you look in the upper left i've got a tab for source control the other indicator for source control is down on the bottom right you can see we are not connected to source control right now if i hover over that but not linked to source control so those are two indicate or one indicator plus this is where we're gonna set it up in the upper left so we'll go ahead and link that to source control and i'm just gonna type in github.com uh my my act my account i'll probably order that out and post and then that was called awesome app is what we named it now the credential you've got to create the credential and service now so it has to be there to select and um the branch i usually just leave this as master now this is where i say i might be into weird territory and not following um the instructions i just wanted to show you what i do um so they say using the default naming convention is strongly encouraged what i want to do is i wanted this to be an app that i go and load in different instances so i want it to pull from the master branch i don't want it to create its own sub branch now i'll show you later on when i do make changes on the creative branch um but that for now that's what i do i'll go ahead and plug in my email address here um and then for the commit comments i'm not going to um put one in here i'm going to actually make commit comments when i change something so this is linking it to source control it was successful and now i have my application and service now connected to my repo in github and there's nothing in my application right now so here's what i want you to do i want you to think about when you create something in service now it could be a workflow it could be a catalog item it could be a playbook it could be a ui script it could be a ui action whatever it is think about creating that in an application and stop using global stop using servicenow applications and pull yourself separate enough away from the out of the box stuff yes there's use cases for doing um using the out-of-box apps and stuff like that and configuring stuff like that but when you're creating something when you're adding something new to service now i want you to think about first creating an app don't forget worry about creating an update set create an app once you've done that you can come in here and you can create whatever you need and usually it's kind of weird to do it from here but i could create a workflow directly from studio and that will pop open flow designer and i can start working in flow designer and and create what i need to create so it's going to pull up the canvas and everything and i can uh look at what i want to this is interesting to you i've actually never seen before i've never seen this uh right hand panel whatever so let's scratch that let's go in the regular way i'm just going to go into my favorites and pull up flow designer yes flow designers are my favorites and i'm going to create a new flow directly from here and the reason i'm doing this is i just want to kind of show you really literally the way i do it so we'll do awesome workflow and awesome workflow here and i want to make sure that's in my new app that's going to be synced to github um so it did default to awesome app so it seems like that's the one i have in scope right now so i'm going to go ahead and submit that and let's pretend okay you and i are going to pretend that i added this really cool workflow with all this different logic and actions so we'll just add an action here as a placeholder um as the processing uh hurries up here i edit this out okay there we go that actually works so we're going to create a task and we're going to do something and i'm going to trigger off a catalog item so that i don't have to put in a bunch of configuration stuff like that so there's my workflow save that i didn't do anything but pretend i did something really cool and awesome right so if i jump back over into studio look it has my awesome workflow already associated with the app so that's there another thing i'll show you here is i could um and i do take advantage of this for my app settings i can control the version of my app using the app settings so i can set it to version 1.0 or 1.1 1.2 or 2.0 stuff like that over in the app settings so i do sometimes play around with that we'll let that load up here in a second upload there it goes we'll point out there there's my version that i have control over there so that just might help me keep track of what i'm doing now here's the magic so i made a change in service now i created a workflow so i go back to source for source control and i can see that i can commit or stash those changes i'm sure stashing is great i haven't had a use case for it yet in my day to day i'm not working with a bunch of different developers doing stuff so my most the time i'm just making uh changes and i want to commit those changes now i showed you earlier the other indicator for source control look over here you can see this app is linked to source control now by the little icon here that's showing that it's linked and i'm in the master branch for that source control which is what i wanted right so let's go ahead and commit the changes that i made we're going to see those here there's awesome workflow uh and it says this hub flow this is going to be synchronized up to github so i can go ahead and continue that and that will go ahead and i can make my commit comment here so i created an awesome workflow in flow designer and now i've committed my changes um up to github and now that's going to be there for me to bring into another instance so let's go look at that what that looks like in github so i'm going to go actually to the code here and we'll see that we've got a created awesome workflow in flow designer it's all in the master branch everything's good now i can go into another instance and pull in that application so i've got another instance up here let me pull this over here this is one of my work instances but not important what's important is i can hop over to studio like we were doing something here now this instance is completely separate from my pdi has nothing to do with that and i can import that application from the source control right so same thing that i would do if i was moving an update set but i'm just grabbing it from the cloud instead of grabbing it from an xml file or something like that so we'll type in my repository name here it was awesome dash app and we'll use uh my credential should be in here i hope it is yeah justin's github and then branch i'm going to set as master again because i want to pull in the top level uh code there i don't want to you know create a branch for this just yet if i make changes to it i'll actually create a branch let's go ahead and import that again separate instance completely different from my pdi it's pulling it in it's enumerating the customizations and it's going to just import that application i'll have access to it in this instance now while that's doing that let's hop over back to my um application in my pdis let's say that i wanted to go make changes and i really don't want to mess with the master bridge because i want to do something i may throw it away i may not this is when i would come up here to my source control again i'm speaking for justin and what justin does this is when i'd actually come and create a branch and it would be i have a new idea for what i want to do i'm going to create that branch it's going to copy everything from the master branch to my new idea branch and i'm going to go make my changes so i can come up here to flow designer and i can go do something else i can send an email or something like that right so that was my idea i was going to send an email now i'm not affecting what's happening in my other instance where i'm importing that app so i'm going to send an email here i'm going to save it i'm not going to put all the details in there but i want to save that so now in my pdi i have this different version of this workflow if we go back to where we were importing that app it actually has that app inside the instance now let's search for awesome there's awesome app and i'll open that up and we'll see when i open this up that i've got awesome workflow i can pull up that workflow and we can see what it looks like we'll see that it has uh that two steps the or not two steps the one step it doesn't have the send email separate now it just has a create task so i'm isolated from that if i come back to my pdi in my flow designer it did save that so let's go ahead and commit those changes we'll commit those there's the awesome workflow we have modified it i'm going to continue i'm going to commit that new send email function or send email action i'm gonna commit that and now that is committed to my new branch right so i have that workflow in my pdi if i go back to the other instance i still have the same workflow we were looking at earlier without the new changes now how do you think that i get those changes up to the let's say i'm happy with them i'm like hey let's do it what you would do or what i've been doing is i go back to github and usually it flashes up at me that there's a branch that has been had a recent push or recent commit and i have the opportunity to pull pull that request and merge it with the master branch so this is where i have control over hey do i want that thing for my pdi which was new idea so i got this branch over here for new idea do i want that committed to my master branch for demo purposes i do so i'll go ahead and compare or pull i'm going to leave all that here and then create the pull request it's going to scan it to see if it's available for automatic merge it's going to be fine most of the time it has been so i'll go ahead and merge that we'll confirm it and then that is now part of the master branch so let's pull this all the way down now let's come back into the instance that doesn't have the new workflow so we'll open that up and uh we should see that it still has the um the one step the create task so now if i want that new change i'll go to source control and i'm going to apply remote changes because service now sees that there's some remote changes so we'll go ahead and apply that it's going to sync back to the master branch and it's going to pull down that revised workflow that i changed to my pdi to this instance and we'll be able to see that when we open the workflow there we go we got success we'll go ahead and close that and now i'll open my workflow in this instance and we should see that i have the new send email step within my workflow i was able to do that without moving xml xml files or update sets and all that stuff there's my new stuff it's now in this instance and that's how i'm moving things back and forth that's how i'm working on things in the interim in order to kind of leave update sets behind and embrace this new source control now i'm one person i'm doing this stuff usually it's just me i'm not interacting with other developers but you can see if you took this to the next level and you're working with a team of people this could be really really valuable and no sending files around or posting them shared drives stuff like that i hope you found this video helpful if you did please like please subscribe or share it with somebody you think might be interested until next time i'll see you on the next one [Applause] [Music] you
https://www.youtube.com/watch?v=pct5iyXhnQc