diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index 1234fa50..38c16957 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -42,6 +42,21 @@
### API Changes
+ [Fixed issue 169 Add crumbFlag to renameJob][issue-169]
+
+ Added supplemental `renameJob` method which supports crumbFlag. Furthermore
+ added `renameJob` which supports folder with and without `crumbFlag`.
+ So we now have the following methods to rename jobs:
+
+```java
+public class JenkinsServer {
+ public void renameJob(String oldJobName, String newJobName) throws IOException;
+ public void renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException;
+ public void renameJob(FolderJob folder, String oldJobName, String newJobName) throws IOException;
+ public void renameJob(FolderJob folder, String oldJobName, String newJobName, Boolean crumbFlag) throws IOException;
+}
+```
+
[Changing getLocalContext(), setLocalContext()][pull-163]
The protected method `getLocalContext()` now returns
@@ -514,6 +529,7 @@ TestReport testReport = mavenJob.getLastSuccessfulBuild().getTestReport();
[issue-162]: https://github.com/jenkinsci/java-client-api/issues/162
[issue-165]: https://github.com/jenkinsci/java-client-api/issues/165
[issue-167]: https://github.com/jenkinsci/java-client-api/issues/167
+[issue-169]: https://github.com/jenkinsci/java-client-api/issues/169
[issue-172]: https://github.com/jenkinsci/java-client-api/issues/172
[pull-123]: https://github.com/jenkinsci/java-client-api/pull/123
[pull-149]: https://github.com/jenkinsci/java-client-api/pull/149
diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
index d68f0a11..565c4ab4 100644
--- a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
+++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
@@ -651,14 +651,74 @@ public Build getBuild(QueueItem q) throws IOException {
}
/**
- * 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));
- }
+ * Rename a job
+ *
+ * @param oldJobName
+ * existing job name.
+ * @param newJobName
+ * The new job name.
+ * @throws IOException
+ * In case of a failure.
+ */
+ public void renameJob(String oldJobName, String newJobName) throws IOException {
+ renameJob(null, oldJobName, newJobName, false);
+ }
+
+ /**
+ * Rename a job
+ *
+ * @param oldJobName
+ * existing job name.
+ * @param newJobName
+ * The new job name.
+ * @param crumbFlag
+ * true
to add crumbIssuer false
otherwise.
+ * @throws IOException
+ * In case of a failure.
+ */
+ public void renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException {
+ renameJob(null, oldJobName, newJobName, crumbFlag);
+ }
+
+ /**
+ * Rename a job
+ *
+ * @param FolderJob
+ * The folder.
+ * @param oldJobName
+ * existing job name.
+ * @param newJobName
+ * The new job name.
+ * @throws IOException
+ * In case of a failure.
+ */
+ public void renameJob(FolderJob folder, String oldJobName, String newJobName) throws IOException {
+ renameJob(folder, oldJobName, newJobName, false);
+ }
+
+ /**
+ * Rename a job
+ *
+ * @param FolderJob
+ * The folder.
+ * @param oldJobName
+ * existing job name.
+ * @param newJobName
+ * The new job name.
+ * @param crumbFlag
+ * true
to add crumbIssuer false
otherwise.
+ * @throws IOException
+ * In case of a failure.
+ */
+ public void renameJob(FolderJob folder, String oldJobName, String newJobName, Boolean crumbFlag) throws IOException {
+
+ String path = "/";
+ if (folder != null) {
+ path = folder.getUrl();
+ }
+ client.post( path +
+ "job/" + EncodingUtils.encode(oldJobName) + "/doRename?newName=" + EncodingUtils.encodeParam(newJobName), crumbFlag);
+
+ }
+
}