Create your first trigger
Follow this workflow to create your first trigger for automation.
Read time 1 minuteLast updated 21 days ago
This page shows a workflow for how to create and edit a trigger that validates your label names through the command line:
- View available triggers.
- Create the trigger.
- View a list of your existing triggers.
- Edit the trigger.
- Delete the trigger.
View trigger types
To associate a user script with a client or server event, you need to create a trigger. To show a list of all supported trigger types in your command line, you can use theshowtypescm trigger showtypesCreate a trigger
If your label names are created according to a given naming standard, you can create a trigger that validates label names. To create this trigger on Windows, you can use the followingcreatecm trigger create before-mklabel "check label name" "ruby c:\plastic\triggers\validate-label.rb"validate-label.rbreleaseif (ENV['PLASTIC_LABEL_NAME'] !~ /^release/) then exit(1) endPLASTIC_LABEL_NAME^releasereleaserelease!~1mklabelList triggers
To see any triggers that you create, you can use the list command to show all the triggers of the same type you created:>cm trigger list before-mklabel1 Validate label c:\tmp\triggers\validate-label.bat dave
Edit triggers
To modify the script that this trigger is pointing to, you can use the triggereditcm trigger edit before-mklabel 1 --script="c:\tmp\other-script.bat"Delete triggers
To remove a trigger, you can use the triggerdeletecm trigger delete before-mklabel 1