【问题标题】:Having trouble creating a milestone in a specific project在特定项目中创建里程碑时遇到问题
【发布时间】:2017-02-09 05:42:15
【问题描述】:

我正在尝试在特定的工作空间中创建一个里程碑。里程碑是在不同的工作空间中创建的。

这里是代码sn-p

            m["Name"] = "xx";
            m["TargetDate"] = "2017-06-01";              
            result = restApi.Create(workspaceRef, "Milestone", m);
            if(result.Success)
            {
                LogWriter.LogWrite(string.Format("The specific milestone {0} has been created!", name));
                m = restApi.GetByReference(result.Reference, "FormattedID");
                LogWriter.LogWrite(string.Format("The specific milestone has been created with formattedId {0}", m["FormattedID"]));
                Console.WriteLine(m["FormattedID"]);
            }
            else
            {
                LogWriter.LogWrite(string.Format("Error creating milestone {0}, Exception: {1}", name, result.Errors[0].ToString()));
            }

关于为什么会发生这种情况的任何想法或见解?

谢谢, 瓦桑蒂

【问题讨论】:

    标签: c# rest rally milestone


    【解决方案1】:

    我认为这是 .NET 工具包中的一个错误。不过,您应该能够通过设置 Milestone 的 Workspace 属性而不是使用采用 workspaceRef 的 Create 的重载来解决它:

    m["Workspace"] = workspaceRef;
    result = restApi.create("Milestone", m);
    

    我从来没有发现所有使用 workspaceRef 的 CRUD 方法的重载对我自己很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-07
      • 1970-01-01
      • 2021-06-29
      • 1970-01-01
      • 2014-06-12
      • 1970-01-01
      • 2010-12-14
      • 1970-01-01
      相关资源
      最近更新 更多