Skip to content

Instantly share code, notes, and snippets.

View AATHITH's full-sized avatar
🔥
game on

AATHITH

🔥
game on
View GitHub Profile
@AATHITH
AATHITH / groovy_script_to_copy_jobs.groovy
Created February 19, 2023 11:03
Copy all Jobs from a view into another view | Jenkins
// Get the original view
def originalView = jenkins.model.Jenkins.instance.getView("Old-View-Name")
// Set the new view name
def newViewName = "New-View-Name"
// Check if the new view already exists
def newView = jenkins.model.Jenkins.instance.getView(newViewName)
if (newView == null) {
// If the new view does not exist, create a new ListView