Skip to main content Skip to complementary content

Custom Property: Create

Information noteLOCKED.

This API is extremely reliable and will not be broken unless absolutely necessary.

Method

POST

Path

/qrs/CustomPropertyDefinition

Description

Create a custom property that you can apply to a resource. To learn how to apply a custom property to a resource, see Example: Apply a custom property to a resource.

Body

{ "name": "Region", "valueType": "Text", "choiceValues": [ "Americas", "APAC", "EMEA" ] }

Return value

{ "id": "37e502a9-dbfa-4a1a-8f6e-ade3960b7dfe", "createdDate": "2017-01-06T14:58:27.266Z", "modifiedDate": "2017-01-06T14:58:27.266Z", "modifiedByUserName": "INTERNAL\\sa_repository", "name": "Region", "valueType": "Text", "choiceValues": [ "Americas", "APAC", "EMEA" ], "objectTypes": [], "privileges": null, "impactSecurityAccess": false, "schemaPath": "CustomPropertyDefinition" }

Optional parameters

-

Example: Apply a custom property to a resource

Now that you have a custom property, the next step is to make it available to resources so that you can start using it. In this example, you'll learn how to assign a custom property to a resource such as a user.

  1. Create a custom property. Use the sample code provided above.
  2. Copy the entire response body and paste it into a text editor.

  3. Update the custom property entity so that it can be applied to a user. In this case, you want to assign the User resource type to the custom property.
    1. In the text editor, add "User" to the objectTypes property:

      { "id": "567481ec-d3d2-47db-8f68-ff16c24ad268", "createdDate": "2017-11-24T15:58:19.090Z", "modifiedDate": "2017-11-24T15:58:19.090Z", "modifiedByUserName": "INTERNAL\\sa_repository", "name": "Region", "valueType": "Text", "choiceValues": [ "Americas", "APAC", "EMEA" ], "objectTypes": ["User"], "privileges": null, "schemaPath": "CustomPropertyDefinition" }

    2. Call PUT qrs/CustomPropertyDefinition/567481ec-d3d2-47db-8f68-ff16c24ad268 with the entire contents from the text editor pasted into the request body.

      The custom property is now available to entities of type user.

  4. Assign the custom property to a specific user.

    1. Get the user entity details:

      GET qrs/user/{id}

    2. Copy the entire response body and paste it into a text editor.
    3. Update customProperties as shown in the following code. For "id", substitute the ID of the custom property that you created.

      { "id": "55d82fe1-fd7f-48bb-95f2-dc1969a9df61", "createdDate": "2017-10-31T15:33:42.437Z", "modifiedDate": "2017-11-23T22:03:50.033Z", "modifiedByUserName": "INTERNAL\\sa_repository", "customProperties": [{ "value": "APAC", "definition":{ "id":"567481ec-d3d2-47db-8f68-ff16c24ad268" } }], "userId": "bll", "userDirectory": "INTERNAL", "name": "bll", "roles": [ "RootAdmin" ], "attributes": [], "inactive": false, "removedExternally": false, "blacklisted": false, "deleteProhibited": true, "tags": [], "privileges": null, "schemaPath": "User" }

    4. Call PUT qrs/user/{id} with the entire contents from the text editor pasted into the request body.

      The custom property value "APAC" is applied to the specified user.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!