TRIGGER CREATE

Description

Creates a new trigger on a server.

Usage

cm trigger | tr create | mk <subtype-type> <new_name> <script_path> [--position=<new_position>] [--filter=<str_filter>] [--server=<repserverspec>]

Options

Option / ArgumentDescription
--positionNew position of the specified trigger. This position must not be in use by another trigger of the same type.
--filterChecks only items that matches the specified filter.
--serverCreates the trigger on the specified server. If no server is specified, executes the command on the one configured on the client. (Use 'cm help objectspec' to learn more about repository server specifications.)
subtype-typeTrigger execution and trigger operation. (Use 'cm showtriggertypes' to see a list of trigger types.)
new_nameName of the new trigger.
script_pathDisk path on the server where the script to execute is located. If the command line starts with "webtrigger ", the trigger will be considered as a web trigger. See Remarks for more information.

Help

Remarks

Web triggers: A web trigger is created by typing "webtrigger <target-uri>" as the trigger command. In this case, the trigger will execute a POST query against the specified URI -where the request body contains a JSON dictionary with the trigger environment variables- and a fixed INPUT key pointing to an array of strings.

Examples

cm trigger create after-setselector "BackupMgr" "/path/to/script" --position=4

cm tr mk before-mklabel new "/path/to/script" --server=myserver:8084

cm tr mk after-mklabel Log "/path/to/script" --filter="rep:myRep,LB*"

(This trigger will be executed only if the label name starts with 'LB' and it is being created in a repository called 'myRep'.)

cm tr mk after-checkin NotifyTeam "webtrigger http://myserver.org/api"