diff --git a/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/src/main/java/com/offbytwo/jenkins/JenkinsServer.java index bcd0017f..71402e77 100644 --- a/src/main/java/com/offbytwo/jenkins/JenkinsServer.java +++ b/src/main/java/com/offbytwo/jenkins/JenkinsServer.java @@ -610,4 +610,16 @@ public Build getBuild(QueueItem q) throws IOException { throw e; } } + + /** + * Rename a job + * + * @param jobName Existing Job name + * @param newJobName New Job Name + * @throws IOException In case of a failure. + */ + public void renameJob(String jobName, String newJobName) throws IOException { + client.post( + "/job/" + EncodingUtils.encode(jobName) + "/doRename?newName=" + EncodingUtils.encodeParam(newJobName)); + } }