Configurations

All the configurations and their values have been described below:

 

Custom Actions

    These custom actions include attributes like input fields and output fields, whereas the input fields have valueURL and hooks. You only have to specify the required values in the resources.json file to execute the action. The configurations for custom actions are given below. These configurations are used for fetching the params of an action.

Input Fields

     Input fields are the key user interface design elements, allowing the users to enter non-standardized responses based on their requirements. These input fields include text fields, picklist, date-pickers, checkboxes, lookups, radio buttons, sliders, and any other fields designed for user input.

The attributes for the input fields are given below:

AttributestypeDescription
displayNameStringDisplay name of the input field. Name that must be displayed when rendering this field.
typestring

Type of the input field. The value of this key must be one of the following: STRING|LOOKUP|TEXT|NUMBER|DECIMAL|PICKLIST|URL|MULTIPICKLIST|CONTENT|BOOLEAN|DYNAMICPICKLIST|ARRAY|OBJECT. To find the sample formats of input field types, click here.

lengthIntegerMaximum allowed length for the value of this field. The value of this key must be greater than 0.
mappingTargetTemplateNameStringThe string that will be used in the primary target of the custom action. The input that is given in the field will be replaced in the place of this string in the primary target. The structure of the target will be discussed later.
isMandatoryBooleanIt determines whether the field is mandatory or not
isPlaceHolderNeededBooleanIt determines whether the field needs placeholder support or not. It allows you to map respective module fields available in desk.
contextBooleanIt shows the type of placeholders that must be displayed for the field. This key is optional .The value of this key must be one of the following: tickets|contacts|accounts|tasks|products|events|calls|departments|agents|teams The IDs of the above modules will be shown in the placeholders.
valuesJSONArrayIt is available only for the picklist or multi-picklist types. The values that must be shown for the picklist. This is a static list.
valueUrlURLThe endpoint that must be hit to the values of the field. This can be used to get the dynamic values for the field. There are certain query params that are supported in valueUrl, whose value will be automatically replaced. To check query params, click here.
hooksJSONArrayThe events on which value urls will be called. The events supported are: ON_ENTRY|ON_TYPE|AFTER_SELECTION|ON_BEFORE_LOAD. The events are related to the custom action form and the field rendering. To check the values of this key, click here.
 

Query Params - Value URL

AttributesPlaceholder ValueDescription
page"${PAGE}"Pagination Value. Default value 0.
limit"${LIMIT}"Limit value whose default value is 30.
customActionId"${CUSTOM_ACTION_ID}"Id of the custom action.
searchValue"${SEARCH_VALUE}"Search String, if available.
departmentId"${DEPARTMENT_ID}"Id of the department
mappingTargetTemplateName"${MAPPING_TARGET_TEMPLATE_NAME}"Mapping target template name of the field.
value"${FIELD_VALUE}"Value of the field
event"${EVENT}"Type of the event
mappingId"${MAPPING_ID}"Mapping Id of the rule to which the custom action is mapped.
module"${MODULE}"Module under which the rule mapping is placed.

These values will be in the place of the template based on the available data.

Values for Hooks

AttributesFormatDescription
preRequisites{"teamId":"${this.teamId}"}These are the values that must be sent when calling the valueUrl on a particular event. The key preRequisite is a JSONObject. Placeholders are supported in preRequisites. The placeholder should be in the form of ${this.mappingTargetTemplateName}.
triggerCriteria{"on":["@"]}

It is the criteria where a call will go for the value URL when text/symbol i.e., @ in the editor field matches with the format of trigger criteria in JSON array, based on the particular event. This triggerCriteria is supported only in AFTER_SELECTION and ON_TYPE events.

Note: Prefix keyword of triggerCriteria can be any character such as @, #,etc.

 

Hook Code Structure:

   The code structure for the hooks is as follows:

Copied
    [{ "event": "AFTER_SELECTION", "preRequisites":{"teamId":"${this.teamId}"}, "triggerCriteria":{"on":["@"]} }]
  

Note: Other than Display Name and mappingTargetTemplateName, the values of all other keys can be updated. So, before creating any field decide field's displayName and mappingTargetTemplateName


If the displayName or the mappingTargetTemplateName is changed, the field will be considered as new, and the old field and its value will be lost. So do not update displayName and mappingTargetTemplateName, as they are the main fields of any actions.

 

Sample Format of Input Field Types

Below you can find the sample formats of input field types in UI Level:

Text field / Number field:

Boolean (Check Box):

Picklist:

Multi Picklist:

Lookup / URL Field:

Email Field:

RTE - Rich Text Editor:

Output Fields

These output fields hold the output data. The output of one action can be given as input to the succeeding actions.

The attributes for the output fields is given below:

AttributestypeDescription
displayNameStringDisplay name of the input field.
contextStringContext that is associated with the output field. When the context of one input field matches with the context of output field, then this output field will be shown as placeholders for that input field. The value must be one of the following: TICKETS|CONTACTS|ACCOUNTS|TASKS|PRODUCTS|EVENTS|CALLS|DEPARTMENTS|AGENTS|TEAMS.
typeStringType of the output field. The value must be one of the following: STRING|LOOKUP|TEXT|NUMBER|DECIMAL|PICKLIST|URL|MULTIPICKLIST|CONTENT|BOOLEAN|DYNAMICPICKLIST|ARRAY|OBJECT.
lengthIntegerMaximum allowed length for the value of this field. The value of this key must be greater than 0.
jsonPointerPathStringThis key serves the same as the mappingTargetTemplateName in InputField. When this particular output field is used in other Custom Actions as placeholders, the value of the output field will be prefilled while executing the second custom action with the help of this string. The String must be prefixed with an " / " character.

Note: The input fields of the mappingTargetTemplateName can be used within the JSON while creating the custom actions, and the jsonPointerPath should not be used within the JSON file assuming that it will replace the value. The output fields will only be displayed as placeholders for the following custom actions after installing your particular custom action.

 

Targets

Target is a dependant resource of the custom actions. Target actually defines the execution part of the custom actions.

The attributes for the Targets is given below:

AttributestypeDescription
resourceNameStringIt is the unique identifier of the targets.
targetNameStringThe name of the target. This is the name by which the target will be invoked.
urlStringThe url that must be called when the target will be invoked. The url can have templates. The value of mappingTargetTemplateName will be replaced in the place of templates. The template must be in the format of ${<mappingTargetTemplateName>}.
headersJSONStringThese headers must be attached with the url when the target is invoked. The headers can have templates. The value of mappingTargetTemplateName will be replaced in the place of templates. The template must be in the format of ${<mappingTargetTemplateName>}.
targetTemplateJSONStringThe post body that must be attached when invoking the target. The targetTemplate can have templates. The value of mappingTargetTemplateName will be replaced in the place of templates. The template must be in the format of ${<mappingTargetTemplateName>}.
httpMethodStringThe http method by which url must be called.
connectionNameStringIt helps to authenticate the third-party domain. The value of this parameter must be the same as the one passed in the connectionLinkName value in the plugin manifest.

Notes:

  • Custom actions are the collective resource of targets.
  • The templates {{DESK.CURRENT_DOMAIN_URL}} and {{DESK.CURRENT_ORG}} refer to the current desk domain url and current orgId respectively and will be replaced by the system itself.
  • Other templates like ${<mappingTargetTemplateName>} will be replaced by the inputs given in the input fields of the custom action. The templates will be replaced by the inputs with mappingTargetTemplateName matching the text inside the template.
  • The template {{CONFIG.<config_param_name>}} refer to the config params of the extension.