Java 在Rally中,如何使用Web Services v2.0获取优先级、严重性下拉列表选项
Like优先级可以是高、低、中。 如图所示,以Json格式获取状态下拉列表等的值 像这样的 “国家”:[{ “id”:“1”, “名称”:“打开”Java 在Rally中,如何使用Web Services v2.0获取优先级、严重性下拉列表选项,java,web-services,rally,Java,Web Services,Rally,Like优先级可以是高、低、中。 如图所示,以Json格式获取状态下拉列表等的值 像这样的 “国家”:[{ “id”:“1”, “名称”:“打开” 使用web services V2.0需要此类值您可以使用Name属性查询TypeDefinition对象: https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition?query=(Name = Defect) { "_rallyAPIMajor": "2",
使用web services V2.0需要此类值您可以使用Name属性查询TypeDefinition对象:
https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition?query=(Name = Defect)
{
"_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"
}
将返回对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
使用“缺陷”而不是缺陷类型def的ObjectID将不起作用
现在您获得了缺陷类型定义的属性定义。下面是响应的一个摘录,与状态属性相关:
https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition?query=(Name = Defect)
{
"_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获取状态属性的详细信息:
https://rally1.rallydev.com/slm/webservice/v2.0/AttributeDefinition/-12507/AllowedValues
如果未指定工作区,Attributes端点将返回默认工作区的属性定义和允许值。可以使用“workspace”参数覆盖默认工作区
以下是获取AppSDK2中“ScheduleState”的AllowedValue的示例:
model.getField('ScheduleState').getAllowedValueStore().load({
callback: function(records, operation, success) {
Ext.Array.each(records, function(allowedValue) {
console.log(allowedValue.get('StringValue'));
});
您可能会看到一个应用程序的完整示例,该应用程序基于中“分辨率”字段的允许值构建网格
有关更多详细信息,请参见,但当我做了同样的事情后,我得到了一个响应,其中缺少了一些ElementName,如优先级、严重性等。任何关于这方面的解决方案