How to remove an attachment using JIRA soap service

我的未来我决定 提交于 2019-12-11 12:05:24

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!