| 104 | [[BR]][[BR]] |
| 105 | === Change a [custom] property of any test object === |
| 106 | |
| 107 | Any property, either standard or custom, of any test object can be set programmatically through the RESTful API. |
| 108 | |
| 109 | A test object is identified by its realm (i.e. type) and its key (i.e. in most cases the ID, for test cases in the context of a plan, also the plan ID is required). |
| 110 | |
| 111 | The realms that identify the test objects are the following: |
| 112 | * Test Catalog: testcatalog |
| 113 | * Test Case: testcase |
| 114 | * Test Case in the context of a plan (i.e. with a status): testcaseinplan |
| 115 | * Test Plan: testplan |
| 116 | |
| 117 | The realm must be provided to the property update service through the "realm" parameter. |
| 118 | |
| 119 | The corresponding key properties, needed to identify any particular object, are: |
| 120 | * Test Catalog: id |
| 121 | * Test Case: id |
| 122 | * Test Case in the context of a plan (i.e. with a status): id, planid |
| 123 | * Test Plan: id |
| 124 | |
| 125 | The key properties are provided to the property update service through the "key" parameter, in the form of a dictionary. |
| 126 | |
| 127 | The next things to pass to the service are the name of the property to modify and the new value. Guess what... you use the "name" and "value" parameters, respectively. |
| 128 | |
| 129 | For example, to change a Test Case - with ID 5 - custom property "platform" (which has been previously added to the test case type in the trac.ini file) to the new value "Windows", this is the URL to GET: |
| 130 | |
| 131 | {{{ |
| 132 | <yourserver/yourproject>/testpropertyupdate?realm=testcase&key={'id':'5'}&name=platform&value=Windows |
| 133 | }}} |
| 134 | |