It's a good idea to have your Jenkinscript on some secured public repository (like Git Hub) outside of Jenkin's server, so that if anything happens to the jenkins server, your jenkins script will be preserved.
It also facilitate code versioning and collaboration among DevOps Engineers and Developers etc