喜欢的优先级可以是高、低、中。 如图所示,获取Json形式的状态下拉列表等值 像这样的东西
“状态”:[{ “id”:“1”, “名称”:“打开”,
},
{
"id": "2",
"name": "close",
}]
使用Web服务V2.0需要这种值
最佳答案
您可以使用 Name 属性查询 TypeDefinition 对象:
https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition?query=(Name = Defect)
它将返回对 TypeDefinition 的引用:
_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition/12352608495
现在,如果您使用 TypeDefinition 的 ObjectID,您可能会获得 Attributes 集合:
https://rally1.rallydev.com/slm/webservice/v2.0/TypeDefinition/12352608495/Attributes
使用“Defect”代替缺陷类型 def 的 ObjectID 将不起作用。
现在您获得了缺陷 TypeDefinition 的属性定义。以下是与 State 属性相关的响应摘录:
{
"_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 属性的详细信息:
https://rally1.rallydev.com/slm/webservice/v2.0/AttributeDefinition/-12507/AllowedValues
如果未指定工作区,属性端点将返回默认工作区的属性定义和允许的值。可以使用“workspace”参数覆盖默认工作区。
以下是在 AppSDK2 中获取“ScheduleState”的 AllowedValues 的示例:
model.getField('ScheduleState').getAllowedValueStore().load({
callback: function(records, operation, success) {
Ext.Array.each(records, function(allowedValue) {
console.log(allowedValue.get('StringValue'));
});
您可能会在 this post 中看到基于分辨率字段允许值构建网格的应用程序的完整示例。 .
有关更多详细信息,请参阅 Rally.domain.WsapiField
关于java - 在 Rally 中如何使用 Web 服务 v2.0 获得优先级、严重性下拉列表选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21431677/