我已经为 Rally 中的缺陷配置了一个自定义网络链接字段。我想使用 Rally rest .net api 向 Rally 提交具有自定义 weblink 字段值的新缺陷。
不幸的是,weblink 实例需要 LinkID 和 DisplayString 值,我不知道如何启动 weblink 实例来设置缺陷字段。
我还尝试将 Rally rest .net api 支持的 DynamicJsonObject 设置到该字段,但它仍然失败。
调试截图
请帮忙!
编辑:
我尝试使用以下示例代码发布缺陷:
var api = new RallyRestApi("<myusername>", "<mypassword>", "https://community.rallydev.com");
var defect = new DynamicJsonObject();
defect["Name"] = "Sample Defect";
defect["Description"] = "Test posting defect with weblink type field";
defect["Project"] = "https://trial.rallydev.com/slm/webservice/1.29/project/5839639589.js";
defect["SubmittedBy"] = "https://trial.rallydev.com/slm/webservice/1.29/user/5797741589.js";
defect["ScheduleState"] = "In-Progress";
defect["State"] = "Open";
defect["Severity"] = "Major Problem";
defect["Priority"] = "High Attention";
defect["CustWebLink"] = new DynamicJsonObject(new Dictionary<string, object>
{
{"DisplayString", "abc"},
{"LinkID", "123"}
});
CreateResult creationResult = api.Create("defect", defect);
现在缺陷可以发布到 Rally,但没有 CustWebLink 的值。在调查时,我看到在发布请求的序列化中忽略了 CustWebLink 字段。
Rally.RestApi Post Response: {"CreateResult": {"_rallyAPIMajor": "1", "_rallyAPIMinor": "29", "Errors": [], "Warnings": ["Ignored JSON element defect.CustWebLink during processing of this request."],.....}