Creating a custom rule for attribute mapping

Use this task to create a custom transform for your attribute mapping.

Before you begin

  1. Set up the basic information for the application in the General tab.
  2. Optionally, specify the required information for sign-on or API access.
  3. Enable the account lifecycle section for provisioning or deprovisioning or both.

About this task

In the account lifecycle tab, the administrator can map the attributes that are used to provision accounts to the target application. User can map existing ISV attributes with the target attributes and also add new attribute mappings. With scripting support, an administrator can choose to transform the cloud directory attribute value and set it to a target attribute, as intended for the target application.

For mapping with existing Verify attributes, the administrator chooses existing Verify attributes from the menu and maps them with application target attributes from the Target attribute menu. To transform the value of existing Verify attributes, select the appropriate transformation value from the build-in transformation menu. Otherwise, no transformation is applied by default and the transformation value is None.

Use the following task to create a custom transform for your attribute mapping.

Procedure

  1. In the Account lifecycle tab, scroll to the Attribute mapping section.
  2. Do one of the following actions.
    • Expand the Add attribute menu and select Add custom rule.
    • Select Add attribute and from the Verify attribute menu, select Custom rule.
    The code editor opens.
  3. In the code editor, create the JSON for your rule.
    For example,
    \{
    "user": \{
    "emails": \[
    \{
    "type": "work",
    "value": “Scott@ibm.com”
    }
    ],
    "meta": \{
    "created": "2020-01-24T05:49:25Z",
    "lastModified": "2020-12-07T07:45:40Z",
    "resourceType": "User"
    },
    }
    With this JSON the user's email attributes information can be fetched as user.emails[0].value.
  4. Make sure that the rule works.
    1. Select Show.
      A sample JSON editor shows the cloud directory attribute values for logged-in user. You can choose to search for a particular user for verifying the custom rule.
    2. Select Run test.
    3. Verify that a correct value is returned in the Results section.
      For more information about writing custom rules, see Attribute functions.
    4. Select Save.
    Note: After you create a custom rule, you can select the pencil icon to edit it.
  5. From the Target attribute menu, select the attribute.