1
0
Fork 0

Merge pull request #116 from hibi/attachment-removal

Added support to remove attachment
master
Bob Carroll 2016-03-09 07:42:07 -08:00
commit 7f0a470693
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.
*