Pia Set Tag Activity
Overviewβ
The Pia Set Tag (pia_set_tag) Activity is one of the built in features in package editor that you can use to add or remove tags on a client or an agent. This activity can be used in packages where a client or an agent needs to be tagged automatically when an action is performed.
The Pia Set Tag Activity can be located by simply searching for "Pia" in the list of activities in the package editor:
In the below example, Pia set tag activity is being used to set a custom tag on a client: Note: Pia Set Tag Activity doesn't create tags only adds or removes a pre existing tags to a client or agent
# Orchestrator package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Testing'
- name: 'chat'
option_button: 'pia_set_tag'
option_text: 'pia_set_tag'
option_category: 'pia_set_tag'
steps:
- task: pia_set_tag
inputs:
type: 'client'
id: '2'
tag: 'Test tag50'
action: 'add'
Activity Behaviourβ
The primary purpose of this activity is to add or remove tags on a client or an agent. When the package with set tag activity is executed, user can refer to the Clients screen or the Agents screen in Pia (based on the input type) to verify if the tags have been added to the required client or agent.
The Set Tag Activity can be used in all package executions (i.e. packages that are initiated via Schedule or Ticketing System Event or the Chatbot).
Features of Set Tag Activity
The Set Tag Activity has the following features which make a couple of common scenarios easier:
- Every time pia_set_tag activity is used in Pia package execution, an audit log entry is created to keep track of changes made. This record can be viewed in System Audit Log screen in Pia portal.
- If the Client or Agent has already been tagged with specified Tags, the activity will not make any changes
- The activity allows adding multiple tags in a comma separated format. When multiple tags are defined, Agents or Clients are tagged with all the defined tags.
steps:
- task: pia_set_tag
inputs:
type: 'client'
id: '2'
tag: 'Test tag50, testtag1212'
action: 'add'
An example of each feature above is available at the bottom of this article.
Input Propertiesβ
Use properties to modify the behaviour of the activity.
Property Name: Type
Property Required: Yes
Property Options: 'client' or 'agent'
Property Description: This will determine whether the tag is set on a client record or agent record.
Example:
- task: pia_set_tag
inputs:
type: 'client'
Property Name: Tag
Property Required: Yes
Property Description: This will be the tag for the associated 'type' based on the "Tags" screen. For multiple tags, use comma separated format.
Example:
- task: pia_set_tag
inputs:
type: 'client'
tag: 'cw, test'
Property Name: id
Property Required: Yes
Property Description: This is the unique value of internal client ID or Fully Qualified Name of an Agent.
Example:
- task: pia_set_tag
inputs:
type: 'client'
tag: 'cw'
id: '2'
Property Name: action
Property Required: Yes
Property Options: 'add' or 'remove'
Default Value: 'add'
Property Description: This is the action performed by the activity i.e. whether the specified tag is added or removed from the client/agent.
Example:
- task: pia_set_tag
inputs:
type: 'client'
tag: 'cw'
id: '2'
action: 'add'
Output Propertiesβ
There is no output property available for this activity.
Examplesβ
Adding Tags to a client
# Orchestrator package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Testing'
- name: 'chat'
option_button: 'pia_set_tag'
option_text: 'pia_set_tag'
option_category: 'pia_set_tag'
steps:
- task: pia_set_tag
inputs:
type: 'client'
id: '2'
tag: 'Test tag50'
action: 'add'
In the above package, Pia will use Pia Set Tag Activity to tag our client with a new tag (Test tag50)
Removing Tags from an agent
# Orchestrator package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Testing'
- name: 'chat'
option_button: 'pia_set_tag'
option_text: 'pia_set_tag'
option_category: 'pia_set_tag'
steps:
- task: pia_set_tag
inputs:
type: 'agent'
id: 'pia-dc01'
tag: 'Test tag50, testtag1212'
action: 'remove'
In the above package, Pia will use Pia Set Tag Activity to remove (Test tag50, testtag1212) from an agent