Using the Custom Field macro for notifications
Basic macro
The syntax of the basic Custom Fields macro looks like this:
$CustomField[<object dn>,<custom field label>]$
- object dn (distinguished name) is a string like \VED\Policy\Certificates\www.venafi.example representing either a device or certificate object.
- custom field label is the label used to uniquely identify the field on the configuration in Aperture and when the field appears on device and/or certificate object.
EXAMPLE If the following macro appears in the message body of a notification that was triggered by an event being logged for a certificate, it would return the effective value for the Cost Center custom field:
$CustomField[$Event.Component$,Cost Center]$
Example output:
ABC123
IMPORTANT If the data that you are storing in your custom field contains a comma, the Custom Field macro will automatically escape those commas with a backslash character. This allows the Custom Field macro to be nested in other macros. However, if you do not want the commas to be escaped (for example, a comma-separated list of email addresses), you can use the following syntax to prevent escaping the data within a stored value.
$CustomField[$Event.Component$,Single Value Field,'']$
Macro for multiple stored values
The syntax of the multiple stored values macro looks like this:
$CustomField[<object dn>,<custom field label>,<delimiting characters>]$
If the custom field is capable of storing more than one value (the identity selector, or list with multiple values enabled), you can't output those values as a list. To do that, add a parameter that identifies an escape character, typically the backslash (\
), and a delimiter, typically the comma (,
).
This is useful if, for example, you want to modify the Recipients field of an SMTP channel in order to send email to all of the Escalation Contacts (which is the name of the custom field in the example below).
EXAMPLE This syntax returns a comma separated list of Escalation Contacts expressed as prefixed universals so they can be fed directly into the IdentityEmail macro to get a comma separated list of their email addresses:
$IdentityEmail[$CustomField[$Event.Component$
,
Escalation Contacts,",\"]$]$
Example output:
paul@cyberark.example,susan@cyberark.example,carlos@cyberark.example
Macro for making a multi-select list human readable
For a multi-select list, you may want to output the information in human-readable form. An optional parameter is available for specifying the word (or symbol) used to join the last item to the rest of the list (a conjunction).
$CustomField[<object dn>,<custom field label>,<escape/delimiting chars>,<conjunction>]$
EXAMPLE If you have a multi-select list custom field called Remedy Groups that allows a user to select zero or more predefined items, you would use the following macro to output it as a human readable comma separated list:
$CustomField[$Event.Component$,Remedy Groups,",\","and"]$
Example output:
Application Support, Windows Servers and Unix Servers

-
Use in a Workflow Reason Code Description field assuming that the workflow only applies at stages involving a certificate object:
$CustomField[$Event.Component$,Enterprise Application ID]$
-
Use in the Approver Macro field of a Workflow object (which only accepts identities):
$CustomField[$SelfDN$,Escalation Contact,",\"]$
-
Use in the Injection Commands field of a Workflow object (which only applies to application objects, therefore you must first retrieve the distinguished name of the certificate object assigned to the application object from the Certificate attribute and then obtain the custom field value of the certificate):
$CustomField[$Config[$SelfDN$,Certificate]$,Operating Environment]$