The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sabell2012
Mega Sage
Mega Sage

NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.

 

DIFFICULTY LEVEL:    INTERMEDIATE
Assumes having taken the class SSNF and has good intermediate level of knowledge and/or familiarity with Scripting in ServiceNow.


Some time ago I had need of changing my repository URL for one of my projects in the Studio IDE, and much to my surprise found that I was not allowed to do it! The URL field was read-only!?! Off to the ServiceNow documentation site I went. However, no solution was published there. I promptly went to the Community to find out if this had been mentioned by anyone else.   Sure enough, the question was asked, and @Chuck Tomasi was able to get an answer (How do you edit/remove a source control repository?). But the answer presented there bothered me. 1) it was a work-around, 2) you lost all historical information with the work-around. After my third project re-point, using this method, I began looking around for the best way to hack it (I was that unhappy). I began investigating all the pieces I could find concerning where the URL might be located, and what I would have to write in the way of a Fix Script to do the actual hack.  

 

Well, sometimes the complex way is NOT the solution!  

 

While messing around looking at tables and their interactions I tripped across a method for doing this that looks like it was intentional; sic. out-of-the-box. It was too easy. This method does not hang onto the Source Control Branch or Source Control Tags (a minor loss to me); just so, you are warned.  

 

This article explains how to change the URL using that method.

 

So WHY would you want to change the URL in the first place? Here are some use-cases I can think of just off the top of my head:

 

  • Changing from a personal repository to a corporate repository. My original reason for changing the URL.
  • Reorganization of the repository's directory structure requires changing of the Studio url. This is probably the most important.
  • Unbinding source control from the Studio project.
  • Changing the repository provider. Let's say from GitLab to GitHub or the reverse.

And I am sure there are more.

 

 

First make a backup of your entire project to an Update Set (Best Practice)

 

1. Navigate to System Applications > Applications

2. Click on the link to your Studio Application. This will display the Custom Application properties form.

3. Change the Current Application setting to be the application you are working with. This will activate the Related Links on the form.

 

sabell2012_0-1701730952798.png

 

4. Scroll down the form to view the related links and click on the Publish to Update Set… link. The Publish to Update Set

 

sabell2012_1-1701731016911.png

 

5. Fill in the form:

Version: <<keep what was displayed>>

Description: Repoint to new repository.

Click on the Publish button.

 

6. Wait for the Progress bar to complete and click the Done button. The new update set will be displayed.

7. Under Related Links click the Export to XML related link. This will save a copy of the entire project to your local disk. You might want to rename this with your Application name and version just to be safe.

 

 

To Clear out the Repository URL For an Application

 

Now, on to the good stuff!

 

1. Navigate to sys_repo_branch.list. The Source Control Branches list view will be displayed.

2. Find the Application you wish to reset the repository URL for, and open that record. The Source Control Branch form will be displayed.

 

sabell2012_4-1701732579371.png

 

3. Click on the Repository Configuration link button. The Repository Configuration Record will be displayed.

 

sabell2012_6-1701732674116.png

 

4. Click on the Delete button in the upper right corner of the form. The Confirmation form will appear.

 

sabell2012_8-1701732842468.png

 

5. Click on the Delete button.

 

sabell2012_9-1701732896604.png

 

6. A "Record Not Found" message will be displayed. Ignore this, and go back to the Studio to open your application. If you already have it open, then refresh the browser screen.

7. Open up Source Control > Link to Source Control. You will find that the form has been blanked.

 

sabell2012_10-1701732980277.png

 

8. This cleared out the repository URL and information for the Application. You may now use the normal linking of a repository procedure inside of Studio; to point at your new URL.

 

And there you go! An out-of-the-box method for clearing and/or changing the repository URL for ServiceNow Studio. Maybe in a future release we will get a menu-item or editable URL field inside the Studio to do this, but until then this is the best way.

 

Enjoy!

Steven Bell.

 

If you find this article helps you, don't forget to log in and mark it as "Helpful"!

 

sabell2012_7-1701732717391.png


Originally published on: 3-27-2017 03:03 PM

I updated the code and brought the article into alignment with my new formatting standard.

7 Comments