有关如何以编程方式将文件附加到JIRA中的问题的任何想法? 我需要java代码,应该在我的代码末尾调用,以便它可以自动将我的报告文件上传到现有问题...
我是JIRA的新手......
答案 0 :(得分:1)
从jira 5.x上弃用了MangaerFactory,所以很好用
AttachmentManager attchMgr = ComponentAccessor.getAttachmentManager();
答案 1 :(得分:0)
AttachmentsManager可用于将JAVA File对象附加到JIRA问题。
import java.io.File;
import com.atlassian.jira.issue.AttachmentManager;
import com.opensymphony.user.User;
import java.util.HashMap;
import java.sql.Timestamp;
import com.atlassian.jira.issue.history.ChangeItemBean;
...
File file = new File(FILE_PATH);
AttachmentManager attachmentManager = ManagerFactory.getAttachmentManager();
ChangeItemBean changeItemBean = attachmentManager.createAttachment(file, file.getName(), "text/plain", user, issue.getGenericValue, new HashMap(), timestamp);
来源:http://docs.servicerocket.com/pages/viewpage.action?pageId=1711