您能否通过一个查询获取Rally API要求,缺陷和所有任务 [英] Can you GET Rally API requirements, defects, and all tasks with one query

查看:96
本文介绍了您能否通过一个查询获取Rally API要求,缺陷和所有任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我必须进行多个GET才能接收所需的所有信息

Currently I have to make multiple GETs to receive all the information which I need

  • 用户故事:FormattedID,_refObjectName,状态,Owner._refObjectName
  • 每个用户故事的任务:FormattedID,_refObjectName,状态,Owner._refObjectName
  • 缺陷:FormattedID,_refObjectName,状态,Owner._refObjectName
  • 每个缺陷的任务:FormattedID,_refObjectName,状态,Owner._refObjectName

对于我使用的所有用户故事:

For all of the User Stories I use:

https://rally1.rallydev. com/slm/webservice/1.26/hierarchicalrequirement.js?query =(((Project.Name =" [projectName] "))和(Iteration.Name =" [iterationName] )))& fetch = true& start = 1& pagesize = 100

https://rally1.rallydev.com/slm/webservice/1.26/hierarchicalrequirement.js?query=((Project.Name = "[projectName]") and (Iteration.Name = "[iterationName]"))&fetch=true&start=1&pagesize=100

对于我使用的所有缺陷:

For all of the Defects I use:

https://rally1.rallydev. com/slm/webservice/1.26/defects.js?query =(((Project.Name =" [projectName] "))和(Iteration.Name =" [iterationName] )))& fetch = true& start = 1& pagesize = 100

https://rally1.rallydev.com/slm/webservice/1.26/defects.js?query=((Project.Name = "[projectName]") and (Iteration.Name = "[iterationName]"))&fetch=true&start=1&pagesize=100

在其中的每个任务中,如果有任何任务,则显示为:

Within each of these, if they have any Tasks, they display as:

{
  "_rallyAPIMajor": "1",
  "_rallyAPIMinor": "26",
  "_ref": "https://rally1.rallydev.com/slm/webservice/1.26/task/9872916743.js",
  "_refObjectName": "Update XYZ when ABC",
  "_type": "Task"
}

这没有我需要的所有信息,因此我点击了每个任务的_ref URL以获取完整的任务信息.

This doesn't have all the information I need, so I hit each of the Tasks' _ref URLs to get the full task information.

每页加载有时总共可以进行80多个AJAX调用.

This adds up to sometimes 80+ AJAX calls per page load.

是否有更好的查询可以预先提供额外的任务信息?

Is there a better query which would provide the extra Task information up front?

推荐答案

fetch参数对于查询可能会比较棘手.如果提供fetch=true,您将获得查询类型(Story,Defect)上存在的所有字段.如果该字段也是域对象(例如任务或缺陷),则只会得到像这样的瘦引用对象

The fetch parameter can be tricky with queries. If you provide fetch=true you will get all of the fields that exist on the queried type (Story,Defect). If the field is also a domain object (like a tasks or a defect) you will only get the thin ref object like this

    {
       "_ref": "/task/1234.js"  
    }

如果要在子对象上填充字段,则需要指定要在获取参数fetch=Name,FormattedID,Tasks中显示的字段.这将返回一个类似于以下对象的对象:

If you want to get fields populated on the sub-objects you will need to specify the fields you want shown in the fetch param fetch=Name,FormattedID,Tasks. This would return an object like the one below:

    {
      "HierarchicalRequirement" : {
        "Name" : "StoryName",
        "FormattedID" : "S1234",
        "Tasks" : [
          {
            "_rallyAPIMajor": "1",
            "_rallyAPIMinor": "26",
            "_ref": "https://rally1.rallydev.com/slm/webservice/1.26/task/9872916743.js",
            "_refObjectName": "Update XYZ when ABC",
            "_type": "Task",
            "FormattedID" : "T1",
            "Name" : "Update XYZ when ABC"
          }]

}

让我知道是否有帮助

这篇关于您能否通过一个查询获取Rally API要求,缺陷和所有任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆