How do you keep track of scripts you have written?

richelle_pivec
Mega Guru

So far I've had the "fly by the seat of my pants" approach to keeping track of scripts I've written and solutions I've come up with. Since I can barely remember what I did last week let alone last month, I feel like there has to be a better way to catalog these solutions so I can easily access them again.

So, what do you do? Just leave it in ServiceNow and rely on your memory to hunt it down or do you have some other method?

thanks,

Richelle

1 ACCEPTED SOLUTION

Dominik Simunek
Tera Guru

Hi Richelle,



I use sn-filesync - GitHub - dynamicdan/sn-filesync: 2-way sync ServiceNow field values to local files  


It allows me to write the code in my favorite editor and have it synced to ServiceNow from my local files. Benefit is that it structures all the files into folders based on the type of script etc. At the end I have a structure based on instance / project and then based on type of scripts. I can then easily try to search for my scripts and my solutions within those folders.



Give it a try .


Regards,


Dominik


View solution in original post

6 REPLIES 6

adamrasmussen
Giga Contributor

I actually use a versioning system and I store them in folders/projects based on what type of code/script it is... Business Rules in one, Workflow Scripting in another, etc.



I then make sub-folders/archives based on the next condition (table for BRs, workflow name for WFs, etc.)



So I end up with a structure like:   /Workflows/<workflowname>/IF-<name of if condition> or /Business Rules/sc_req_item/-<name of rule>, etc.   I save these as .js files generally speaking so my editor of choice (notepad++) will do my syntax highlighting, etc.   I also include core orchestration activities and their inputs/outputs.   e.g. /Workflows/<workflowname/Query-AD-<name of query>.


Harry Campbell2
Mega Guru

I am in the same predicament as you.



I have recently set up my own knowledge base that only admins have access to and I add all my new scripts to there.


Dominik Simunek
Tera Guru

Hi Richelle,



I use sn-filesync - GitHub - dynamicdan/sn-filesync: 2-way sync ServiceNow field values to local files  


It allows me to write the code in my favorite editor and have it synced to ServiceNow from my local files. Benefit is that it structures all the files into folders based on the type of script etc. At the end I have a structure based on instance / project and then based on type of scripts. I can then easily try to search for my scripts and my solutions within those folders.



Give it a try .


Regards,


Dominik


This sounds really promising Dominik.   I'll have to check that out.