search cancel

Single Value Drop Down Updates via WSAPI

book

Article ID: 254378

calendar_today

Updated On:

Products

CA Agile Central SaaS (Rally)

Issue/Introduction

How can you update a single value dropdown via Web Services API (WS API)

Resolution

the first step would be to get the object ID of the attribute that you're wanting to update.  This is probably the most complicated part because it requires delving into the schema.  We have a KB here that you can follow to find fields in the schema: https://ca-broadcomcsm.wolkenservicedesk.com/wolken/esd/knowledgebase_search?articleId=223719

So, for example, here we have a custom field called "DropDownList". In order to work with the values for this dropdown list, we'll need to first grab the _ref:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=IFQVI5WzGYMYFoe03u5nTg==

To get the AllowedValues, you would append /AllowedValues to the object ID I have circled above: https://rally1.rallydev.com/slm/webservice/v2.0/AttributeDefinition/230632162424/AllowedValues

In this list, you can see the individual values in the dropdown and their associated object IDs:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=FaafNJscdCuNqEgFk9DlPw==

Using these object IDs you can perform standard update and delete operations.

For example, to delete "Beta" in the above list, make a DELETE method call to:

https://rally1.rallydev.com/slm/webservice/v2.0/AllowedAttributeValue/337398828652

 

To update the "Alpha" value in the above list make a POST method call to :

https://rally1.rallydev.com/slm/webservice/v2.0/AllowedAttributeValue/337398828648

Using a payload like

{
  "AllowedAttributeValue": 
    {
        "StringValue": "Delta"
    }
}