Add action to set bug's resolution
j2bugzilla allows to set a bug's resolution, but currently does not
push the resolution to bugzilla, hence we bump the required j2bugzilla
version and hope for j2bugzilla upstream acceptance of our patch.
Change-Id: Icc81b44c56326e4dd458c611ef173e640fc1a5c7
diff --git a/pom.xml b/pom.xml
index 3cb29aa..d823d18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,7 +98,7 @@
<dependency>
<groupId>com.j2bugzilla</groupId>
<artifactId>j2bugzilla</artifactId>
- <version>2.1.1</version>
+ <version>2.2-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaClient.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaClient.java
index 6321a48..79c2be4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaClient.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaClient.java
@@ -78,6 +78,8 @@
if (validateAction(actionName, actionValue)) {
if (actionName.equals("status")) {
bug.setStatus(actionValue);
+ } else if (actionName.equals("resolution")) {
+ bug.setResolution(actionValue);
}
}
connector.executeMethod(new UpdateBug(bug));
@@ -101,6 +103,7 @@
public Map<String, Fields> getFields() {
Map<String, Fields> fields = new HashMap<String, Fields>();
fields.put("status", Fields.STATUS);
+ fields.put("resolution", Fields.RESOLUTION);
return fields;
}
diff --git a/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md
index 5f361c2..81c84ac 100644
--- a/src/main/resources/Documentation/config.md
+++ b/src/main/resources/Documentation/config.md
@@ -123,6 +123,11 @@
any of the values your bugzilla configuration allows as status. Be
aware, that changing a bug from any status for open bugs to a status
for closed bugs will not work, as the resolution would be missing.
+ resolution RESOLUTION
+ change the associated bug's resolution to RESOLUTION, where
+ RESOLUTION can be any of the values your bugzilla configuration
+ allows as resolution. Setting the resolution has only an effect if
+ the associated bug is in a closed state.
`<change-action>`
: Action performed on Gerrit change-id, possible values are: