问题
Reading the API I don't see any methods that can do this?
http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html
回答1:
Yes, it would need a custom SOAP plugin. Not too hard, just annoying that the method isn't there.
~Matt
回答2:
SOAP doesn't support this, but you can do it via HTTP, e.g. (C#)
using (System.Net.WebClient client = new System.Net.WebClient())
{
string url = "http://jira-server/secure/DeleteAttachment.jspa?id=" +
issue.id + "&deleteAttachmentId=" + attachment_id;
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
string response = client.DownloadString(url);
// do whatever validation/reporting with the response...
}
You can check the url from your web browser - has to be the deletion confirmation page, not the link from the initial delete button.
来源:https://stackoverflow.com/questions/6057411/how-to-remove-an-attachment-using-jira-soap-service