Trigger create command reference
Find the options and arguments you can use to create triggers from the Unity Version Control command line.
Read time 2 minutesLast updated 5 days ago
The command creates a new trigger on a server.
cm trigger createUsage
cm trigger | tr create | mk <subtype-type> <new_name> <script_path> [--position=<new_position>] [--filter=<str_filter>] [--server=<repserverspec>]
cm trcm triggermkcreateOptions and arguments
The command accepts the following options and arguments:
cm trigger createOption or argument | Required | Description |
|---|---|---|
| Yes | Trigger execution and trigger operation. To see a list of trigger types, run |
| Yes | Name of the new trigger. |
| Yes | Disk path on the server where the script to execute is located. If the path starts with |
| No | Position of the new trigger. This position must not be in use by another trigger of the same type. |
| No | Checks only items that match the specified filter. |
| No | Creates the trigger on the specified server. If you don't specify a server, the command runs on the server that the client is configured to use. To learn more about server specifications, run |
Remarks
To create a web trigger, set to . The trigger then sends a POST request to the URI. The request body contains a JSON object with the trigger environment variables and an key that holds an array of strings.
script_pathwebtrigger <target-uri>INPUTExample commands to create triggers
Create a trigger of type :
after-setselectorcm trigger create after-setselector "BackupMgr" "/path/to/script" --position=4
Create a trigger of type on the server :
before-mklabelmyserver:8084cm tr mk before-mklabel new "/path/to/script" --server=myserver:8084
Create a trigger that runs only when someone creates a label whose name starts with in the repository:
LBmyRepcm tr mk after-mklabel Log "/path/to/script" --filter="rep:myRep,LB*"
Create a web trigger of type :
after-checkincm tr mk after-checkin NotifyTeam "webtrigger http://myserver.org/api"