{"id":5478,"date":"2018-10-14T00:33:08","date_gmt":"2018-10-14T00:33:08","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=5478"},"modified":"2018-12-03T13:56:48","modified_gmt":"2018-12-03T13:56:48","slug":"helix-core-trigger-script-variables-reference-guide","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/helix-core-trigger-script-variables-reference-guide\/","title":{"rendered":"Helix Core Trigger script variables Reference Guide"},"content":{"rendered":"<div><a name=\"1057453\"><\/a>Use the following variables in the\u00a0command\u00a0field to pass data to a trigger script:<\/div>\n<table cellspacing=\"0\">\n<caption>\u00a0<\/caption>\n<tbody>\n<tr>\n<td>\n<div><a name=\"1058855\"><\/a>Argument<\/div>\n<\/td>\n<td>\n<div><a name=\"1058857\"><\/a>Description<\/div>\n<\/td>\n<td>\n<div><a name=\"1058859\"><\/a>Available for type<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062177\"><\/a>%action%<\/div>\n<\/td>\n<td>\n<div><a name=\"1063858\"><\/a>Either null or a string reflecting an action taken\u00a0to a changelist or job.<\/div>\n<div><a name=\"1063859\"><\/a>For example, &#8220;pending change 123 added&#8221; or &#8220;submitted change 124 deleted&#8221; are possible\u00a0%action%\u00a0values on\u00a0change\u00a0forms, and &#8220;job000123 created&#8221; or &#8220;job000123\u00a0edited&#8221; are possible\u00a0%action%\u00a0values for\u00a0job\u00a0forms.<\/div>\n<\/td>\n<td>\n<div><a name=\"1062181\"><\/a>form-commit<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062183\"><\/a>%changelist%,\u00a0%change%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062185\"><\/a>The number of the changelist being submitted.\u00a0The abbreviated form\u00a0%change%\u00a0is equivalent to\u00a0%changelist%.<\/div>\n<div><a name=\"1064969\"><\/a>A\u00a0change-submit\u00a0trigger is passed the pending changelist number; a\u00a0change-commit\u00a0trigger receives the committed changelist number.<\/div>\n<\/td>\n<td>\n<div><a name=\"1062187\"><\/a>change-submit,<br \/>\nchange-content,<br \/>\nchange-commit,<br \/>\nfix-add,<br \/>\nfix-delete,<br \/>\nform-commit,<br \/>\nshelve-commit<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1066086\"><\/a>%changeroot%<\/div>\n<\/td>\n<td>\n<div><a name=\"1066088\"><\/a>The root path of files submitted<\/div>\n<\/td>\n<td>\n<div><a name=\"1066090\"><\/a>change-commit<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062189\"><\/a>%client%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062191\"><\/a>Triggering user&#8217;s client workspace name.<\/div>\n<\/td>\n<td>\n<div><a name=\"1062193\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062195\"><\/a>%clienthost%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062197\"><\/a>Hostname of the client.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065761\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062201\"><\/a>%clientip%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062203\"><\/a>The\u00a0IP address of the client.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065771\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062207\"><\/a>%jobs%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062209\"><\/a>A string of job numbers, expanded to one\u00a0argument for each job number specified on a\u00a0p4 fix\u00a0command or for each job number added to (or removed from) the\u00a0Jobs:\u00a0field in a\u00a0p4 submit, or\u00a0p4 change\u00a0form.<\/div>\n<\/td>\n<td>\n<div><a name=\"1062214\"><\/a>fix-add<br \/>\nfix-delete<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1063892\"><\/a>%oldchangelist%<\/div>\n<\/td>\n<td>\n<div><a name=\"1063894\"><\/a>If a changelist is renumbered on submit, this\u00a0variable contains the old changelist number.<\/div>\n<\/td>\n<td>\n<div><a name=\"1063896\"><\/a>change-commit<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062216\"><\/a>%serverhost%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062218\"><\/a>Hostname of the Perforce server.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065783\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062222\"><\/a>%serverip%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062224\"><\/a>The\u00a0IP address of the server.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065777\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062228\"><\/a>%serverport%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062230\"><\/a>The\u00a0IP address and port of the Perforce server, in the format\u00a0ip_address:port.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065789\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062234\"><\/a>%serverroot%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062237\"><\/a>The\u00a0P4ROOT\u00a0directory of the Perforce server.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065795\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062241\"><\/a>%user%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062243\"><\/a>Perforce username of the triggering user.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065801\"><\/a>all but\u00a0archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062247\"><\/a>%formfile%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062249\"><\/a>Path to temporary form specification file. To\u00a0modify the form from an\u00a0in\u00a0or\u00a0out\u00a0trigger, overwrite this file. The file is read-only for triggers of type\u00a0saveand\u00a0delete.<\/div>\n<\/td>\n<td>\n<div><a name=\"1062251\"><\/a>form-commit,<br \/>\nform-save,<br \/>\nform-out,<br \/>\nform-in,<br \/>\nform-delete<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062253\"><\/a>%formname%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062255\"><\/a>Name of form (for instance, a branch name or a\u00a0changelist number).<\/div>\n<\/td>\n<td>\n<div><a name=\"1062257\"><\/a>form-commit,<br \/>\nform-save,<br \/>\nform-out,<br \/>\nform-delete<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1062265\"><\/a>%formtype%<\/div>\n<\/td>\n<td>\n<div><a name=\"1062267\"><\/a>Type of form (for instance,\u00a0branch,\u00a0change, and so on).<\/div>\n<\/td>\n<td>\n<div><a name=\"1062269\"><\/a>form-commit,<br \/>\nform-save,<br \/>\nform-out,<br \/>\nform-in,<br \/>\nform-delete<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1065022\"><\/a>%op%<\/div>\n<\/td>\n<td>\n<div><a name=\"1065024\"><\/a>Operation:\u00a0read,\u00a0write, or\u00a0delete<\/div>\n<\/td>\n<td>\n<div><a name=\"1065026\"><\/a>archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1065028\"><\/a>%file%<\/div>\n<\/td>\n<td>\n<div><a name=\"1065976\"><\/a>Path of archive file based on depot&#8217;s\u00a0Map:\u00a0field.<\/div>\n<div><a name=\"1065977\"><\/a>If the\u00a0Map:\u00a0field is relative to\u00a0P4ROOT, the\u00a0%file%\u00a0is a server-side path relative to\u00a0P4ROOT.<\/div>\n<div><a name=\"1065978\"><\/a>If the\u00a0Map:\u00a0field is an absolute path, the\u00a0%file%\u00a0is an absolute server-side path.<\/div>\n<\/td>\n<td>\n<div><a name=\"1065032\"><\/a>archive<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div><a name=\"1065034\"><\/a>%rev%<\/div>\n<\/td>\n<td>\n<div><a name=\"1065036\"><\/a>Revision of archive file<\/div>\n<\/td>\n<td>\n<div><a name=\"1065038\"><\/a>archive<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Use the following variables in the\u00a0command\u00a0field to pass data to a trigger script: \u00a0 Argument Description Available for type %action% Either null or a string reflecting an action taken\u00a0to a changelist or job. For example, &#8220;pending change 123 added&#8221; or &#8220;submitted change 124 deleted&#8221; are possible\u00a0%action%\u00a0values on\u00a0change\u00a0forms, and &#8220;job000123 created&#8221; or &#8220;job000123\u00a0edited&#8221; are possible\u00a0%action%\u00a0values for\u00a0job\u00a0forms&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[370],"tags":[5092,5071,278,818,317],"class_list":["post-5478","post","type-post","status-publish","format-standard","hentry","category-perforce","tag-core","tag-helix","tag-script","tag-trigger","tag-variables"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=5478"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5478\/revisions"}],"predecessor-version":[{"id":5479,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5478\/revisions\/5479"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}