在 Rally 中如何使用 Web Services v2.0 获得优先级、严重性下拉列表选项 [英] In Rally how can get priority, severity drop list options using Web Services v2.0

查看:27
本文介绍了在 Rally 中如何使用 Web Services v2.0 获得优先级、严重性下拉列表选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜欢的优先级可以是高、低、中.如图,以Json形式获取状态下拉列表等的值像这样的东西

Like priority can be High,Low ,Medium. As shown in diagram , get value of state drop down list etc in Json form something like this

状态":[{"id": "1","name": "打开",

"State": [{ "id": "1", "name": "open",

    },
    {
        "id": "2",
        "name": "close",

    }]

使用网络服务 V2.0 需要这种值

Need this kind of values using web services V2.0

推荐答案

您可以使用 Name 属性查询 TypeDefinition 对象:

You may query on TypeDefinition object using Name attribute:

https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition?query=(Name = Defect)

这将返回对 TypeDefinition 的引用:

which will return a reference to the TypeDefinition:

_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition/12352608495

现在,如果您使用 TypeDefinition 的 ObjectID,您可能会进入 Attributes 集合:

Now if you use the ObjectID of the TypeDefinition you may get to Attributes collection:

https://rally1.rallydev.com/slm/webservice/v2.0/TypeDefinition/12352608495/Attributes

使用Defect"代替缺陷类型 def 的 ObjectID 将不起作用.

Using "Defect" instead of ObjectID of defect type def will not work.

现在您获得了缺陷 TypeDefinition 的属性定义.以下是响应的摘录,与 State 属性相关:

Now you get attribute definitions of defect TypeDefinition. Here is an excerpt from the response, related to State attribute:

{
        "_rallyAPIMajor": "2",
        "_rallyAPIMinor": "0",
        "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/attributedefinition/-12507",
        "_objectVersion": "1",
        "_refObjectName": "State",
        "CreationDate": "2006-02-11T12:29:05.000Z",
        "_CreatedAt": "Feb 11, 2006",
        "ObjectID": -12507,
        "Subscription": {...},
        "Workspace": null,
        "AllowedQueryOperators": {...},
        "AllowedValueType": null,
        "AllowedValues": {
          "_rallyAPIMajor": "2",
          "_rallyAPIMinor": "0",
          "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/AttributeDefinition/-12507/AllowedValues",
          "_type": "AllowedAttributeValue",
          "Count": 4
        },
        "AttributeType": "RATING",
        "Constrained": true,
        "Custom": false,
        "ElementName": "State",
        "Filterable": true,
        "Hidden": false,
        "MaxFractionalDigits": -1,
        "MaxLength": 128,
        "Name": "State",
        "Note": "State of the defect",
        "Owned": true,
        "ReadOnly": false,
        "Required": true,
        "SystemRequired": true,
        "Type": "string",
        "VisibleOnlyToAdmins": false,
        "_type": "AttributeDefinition"
      }

您可以使用以上响应中提供的 URL 获取 State 属性的详细信息:

You can get the details of State attribute using this URL available from the response above:

https://rally1.rallydev.com/slm/webservice/v2.0/AttributeDefinition/-12507/AllowedValues

如果未指定工作区,则属性端点返回默认工作区的属性定义和允许值.可以使用workspace"参数覆盖默认工作区.

The Attributes endpoint returns the attribute definitions and allowed values for the default workspace if the workspace is not specified. The default workspace can be overridden with the "workspace" parameter.

以下是在 AppSDK2 中获取ScheduleState"的 AllowedValues 的示例:

Here is an example of getting AllowedValues for 'ScheduleState' in AppSDK2:

 model.getField('ScheduleState').getAllowedValueStore().load({
                                callback: function(records, operation, success) {
                                    Ext.Array.each(records, function(allowedValue) {
                                    console.log(allowedValue.get('StringValue'));
                                    });

您可能会在 这篇文章.

更多详情请参见Rally.domain.WsapiField

这篇关于在 Rally 中如何使用 Web Services v2.0 获得优先级、严重性下拉列表选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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