In Rally how can get priority, severity drop list options using Web Services v2.0

不打扰是莪最后的温柔 提交于 2019-12-13 02:00:36

问题


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

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

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

    }]

Need this kind of values using web services V2.0


回答1:


You may query on TypeDefinition object using Name attribute:

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

which will return a reference to the TypeDefinition:

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

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

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

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"
      }

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

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.

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'));
                                    });

You may see a full example of an app that builds a grid based on allowed values for Resolution field in this post.

For more details see Rally.domain.WsapiField




回答2:


But when i had done the same thing i got response in which some of ElementName is missing like Priority,Severity etc. Any Solution on this.



来源:https://stackoverflow.com/questions/21431677/in-rally-how-can-get-priority-severity-drop-list-options-using-web-services-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!