English 中文(简体)
查询格式化ID时的意外结果
原标题:Unexpected results when querying on FormattedID
  • 时间:2012-05-25 13:14:22
  •  标签:
  • c#
  • rally

我建立了一个自定义集成, 通过格式化的 ID 查询 API 。 在有不同类型的重复身份( US181 & amp; DE181) 的情况下, 我通常只收到系统回覆的单一回复, 这似乎是错误的文物 。 我想使用格式化身份( US181 或 181) 搜索任务、 故事和缺陷, 并获得合适的结果 。

C#代码如下:

public static string FindArtifactByFormattedId(string formattedId)
    {
        string artifactRef = null;

        Request req = new Request("Artifact");
        req.Query = new Query("FormattedId", Query.Operator.Equals, formattedId.Remove(0,2));
        req.Workspace = rallyWorkspace;
        QueryResult queryResult = restApi.Query(req);
        if (queryResult.TotalResultCount > 0)
        {
            foreach(DynamicJsonObject djo in queryResult.Results)
            {
                if (djo["FormattedID"] == formattedId)
                {
                    artifactRef = djo["_ref"];
                    break;
                }
            }
        }

        return artifactRef;
    }
问题回答

这似乎是我们WSAPI的缺陷。 我已经在内部归档了这个文件, 这样它就可以被优先排序, 在那之前, 您可以随时查询每个个体的文物, 以查找 FlundedID 的具体文物 。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签