Previous Topic: Create a PolicyNext Topic: Conditions Based on the Attributes of Requests


How to Create a Condition

The condition is the major decision point of the policy. If the condition is met, the Catalog system assigns the pending action to the assignees, typically to approve, reject, or fulfill a requested item. You specify the condition using the attributes of CA Service Catalog elements such as users, requests, services, business units, and so forth. In addition, you can use match functions for creating conditions based on service options and service option elements.

Create simple conditions based on known attributes, such as category, external_id, code, item type, cost, status, and so forth. In the condition, you specify the criteria that the value of the specified attribute must meet to assign the pending action.

To create a condition, follow this process:

  1. When you create a policy or edit one, you decide the condition for assigning the pending action to the approvers or fulfillers you specify. Examples follow:

    Note: As a best practice, write meaningful details in the Description field.

  2. Create a condition based on your decision by entering your criteria as an expression in the Condition field.

    The condition builder is the tool in the Condition field that helps you specify valid conditions, one segment at a time. When you initially move the cursor to the field, the condition builder prompts you with valid options for the first part of the condition. These options appear in a drop-down list under the Condition field; select the option you want from the list to populate the field. As you complete each part of the condition, the condition builder continues to prompt you with valid options for the next part. This process continues until the condition is finished, typically with a closing parenthesis.

    The condition must be a valid JavaScript expression, as explained and illustrated in this topic and related topics in this documentation.

    Typically specify one condition per policy, using the following format:

    $(_.group.attribute operator 'value')

    group

    Specifies service, request, business unit, or any other group illustrated in the types of conditions linked at the end of this step.

    attribute

    Specifies any attribute of that group

    operator

    Specifies one of the following:

    value

    Specifies a literal value, typically the name of a business unit, request, service, service option group, or user.

    Enter numeric values without quotation marks, for example: $(_.request.bu.status==0)

    Enclose string values in single quotation mark; for example: $(_.request.bu.taxRegion =='South')

    If a string value includes a single or double quotation mark, precede that mark with a backslash (\) as the "escape" character. For example, if the service name is Demandes d'IP Statique, then specify the condition as follows: $(_.service.name=='Demandes d\'IP statique')

    As you construct an expression in the Condition Builder, the data type (string or numeric) of the attribute appears on the right, letting you know whether to use quotation marks around the value.

    For example: $(_.service.name=='Procure Server')

    This condition means that when the name of the service is Procure Server, the users you specify are assigned as actors, typically approvers or fulfillers.

    For example: $(_.request.estimatedCost >==1000)

    This condition assigns the pending action to the specified approvers or fulfillers when the estimated cost of the total request is greater than or equal to $1,000.

    As a best practice, write the expression to be as simple as possible. However, if necessary, specify multiple conditions, such as compound or complex conditions, in the same expression. Use the following logical operators:

    Specify one of the following types of conditions. The linked sections explain how to specify the complete condition.

  3. Save your selections.
  4. Perform the remaining steps to finish creating the policy.