Version Control for scripts in Jira Cloud

The Easy Way - Starting with an empty silprograms folder

Usually trying to clone into a local repository that has other files or folders in it will cause the attempt to fail. So, starting out with a clean silprograms folder is the best way to start. Or, optionally, an empty subfolder underneath silprograms can be used. It all depends on how you want to control your versions, as one set of scripts or as multiple, project based submodules.

To convert a folder in the silprograms folder you will create and run a script. However, there is a catch. If you create a script in the silporgrams folder than it will not be empty and the attempt will fail! So, the trick is to change your working folder in the SIL Manager to the Home folder. This folder usually is reserved for settings files and templates, however, it will work just fine for a script (just this once (wink)).

Steps for cloning a git repo into an empty folder:

  1. Create a file called gitClone.sil under the Home directory
  2. Copy and paste the code (below) into the file
  3. Modify the command to reflect your git repository address and which folder to create the repo in
  4. Save the file
  5. Run the file from the SIL Manager
  6. Navigate back to the silprograms folder

Example 1 - Using the main silprograms folder as the repo

return system("git clone https://bitbucket.cprime.io/scm/cap/jira-admin-service-desk.git " + silEnv("sil.home"));

Example 2 - Using a subfolder as the repo

return system("git clone https://bitbucket.cprime.io/scm/cap/jira-admin-service-desk.git " + silEnv("sil.home") + "/Automated_Service_Desk);