Rest API PUT operation on property with validation rule
search cancel

Rest API PUT operation on property with validation rule

book

Article ID: 377449

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

We used Rest API PUT operation to update/add value of regular property in iss_prp, it worked fine.

However, for dropdown type property, though the property seemed like got updated, but once clicked on Edit from web interface for the issue ticket, the property didn't show and after save, it's value was gone. 

 

Environment

CA Service Desk Manager 17.3 and higher

Resolution

For a dropdown type of property, that is, a property with some validation rule, you would need to update at least these three values:

validation_rule, validation_type  and value

not only the value as you do for the regular simple properties.

validation_rule is the id comes from prpval_rule using GET operation with WC=sym%3D'the-rule-name', the validation_type is 100003 for dropdown, 100002 for checkbox. In your case it should be 100003.

This is an example of the PUT operation values for issue dropdown property:

"<iss_prp>" +
"<validation_rule>400001</validation_rule>" + "<validation_type>100003</validation_rule>" + "<value>8 GB</value>" +
"</iss_prp>"

Note: The same applies to other ticket type ticket properties. For example, cr_prp.

Additional Information

Since the prpval_rule ids are static, one can also query the mdb table prpval_rule for the ids and rule names

select id, sym from prpval_rule

and pass the output list to their programmers and their programmers won't need to do GET for these ids.