Previous Topic: Use the Action Builder to Specify AssigneesNext Topic: How to Enable Rules and Actions for Policies


Use an API Plug-in to Specify Assignees

Specifying assignees is a required task when you create policies. To specify assignees, use an API plug-in as follows or use the Action Builder. An API plug-in is most useful when you query an external system for data used to specify the assignees. An API plug-in is also useful when the identities and number of assignees vary, depending on the data supplied in the request. Based on this data, the plug-in dynamically creates the assignee list and specifies the assignee levels.

Follow these steps:

  1. Click Catalog, Policies, and open the policy.
  2. Select Use Plug-in for Assignees. This check box appears under the Condition field.

    The Action Builder disappears, and the fields mentioned in the next step appear.

  3. Complete the fields:
    Plug-in Id

    Specifies the ID of your custom plug-in for dynamically populating the list of assignees. You or another administrator must have previously written, tested, and loaded this plug-in.

    To view the list of plug-ins, select Administration, Tools, Plug-ins.

    (Optional) Variables

    Specify the list of variables for the plug-in, if necessary.

    If applicable, open the plug-in that you selected to display its details, including variables. On the details page, the Inputs section lists the ID values and descriptions of the input variables for the plug-in. Copy the ID values of the variables that you want from that page and paste them into the value of the Variables attribute. Enter variables as a JSON expression.

You have specified assignees for this policy.

Example: Use of Variables

For example, the list of assignees could vary depending on the context of the request. Use a plug-in to populate the list of assignees based on the context in which the policy runs. Here, context means the user, business unit, service, and so forth.

$({'form_field_value':_.sog['sog1'].serviceoption[2].form['form1'].txt1, 'est_service_cost':_.service.estimatedCost, 'est_sog_cost':_.sog['sog1'].estimatedCost, 'req_status':_.request.status})

These variables return data to the plug-in, as follows:

The data from the variables populates the list of assignees and the levels of approval, according to the code specified in the plug-in. For example, you can write the plug-in to specify that if the following conditions are true, then trigger the following action:

Conditions:

Action: Create the following assignment table: