1
0
Fork 0

Added support to remove attachment

master
Jakub Hübner 2015-12-10 11:13:03 +01:00
parent 12f11ce2c3
commit 9ac2914c7d
1 changed files with 20 additions and 0 deletions

View File

@ -838,6 +838,26 @@ public class Issue extends Resource {
}
}
/**
* Removes an attachments.
*
* @param attachmentId attachment id to remove
*
* @throws JiraException when the attachment removal fails
*/
public void removeAttachment(String attachmentId) throws JiraException {
if (attachmentId == null) {
throw new NullPointerException("attachmentId may not be null");
}
try {
restclient.delete(getBaseUri() + "attachment/" + attachmentId);
} catch (Exception ex) {
throw new JiraException("Failed remove attachment " + attachmentId, ex);
}
}
/**
* Adds a comment to this issue.
*