[英]How to attach files to Mantis Connect mc_issue_add
我想知道是否可以在MantisConnect上使用文件名附加文件。 我試過ff沒有運氣。
var mc = new MantisBt.Service.Client.MantisBt.Api.MantisConnect();
IssueData iIssue = new IssueData() {
//some other properties here...
attachments = new AttachmentData[] {
filename = "path-to-my-attachment",
date_submitted = DateTime.Now
}
};
string issueID = mc.mc_issue_add(MyUserID, MyPassword, iIssue);
該問題已發布在Mantis中,但未添加附件。 我確定"path-to-my-attachment"
存在: (FileInfo.Exists == true)
我也嘗試過:
IssueData iIssue = new IssueData();
//some other properties here
iIssue.attachments =
//tried converting a List<AttachmentData> to array
//tried the usual AttachmentData[] method
//tried adding AttachmentData["length here"]
但同一件事,問題已發布,未添加附件。
任何人?
您要查找的功能是mc_issue_attachment_add
, mc_issue_add
和mc_issue_update
不允許添加附件。
我發現以某種方式填充IssueData的附件屬性並通過mc_issue_add
或mc_issue_update
保存問題不會保存附件。 唯一的方法是先保存問題,使用ID然后使用mc_issue_attachment_add
。
所以不行。 您不能使用attachments
屬性添加批量附件。 您需要使用mc_issue_attachment_add
一對一添加它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.