Trigger script variables
You can use trigger script variables to pass data to a trigger script. All data is passed as a string; it is up to the trigger to interpret and use these appropriately.
It is also possible to have the server and trigger communicate using STDIN and STDOUT. For more information, see Communication between a trigger and the server.
The maxError…
variables refer to circumstances that
prevented the server from completing a command; for example, an operating
system resource issue. Note also that client-side errors are not always
visible to the server and might not be included in the
maxError
count.
The terminated
and termReason
variables indicate
whether the command exited early and why.
The processing of unknown variables has changed. Previously, unknown variables were removed from the trigger invocation. Currently they are left as is. This preserves the trigger argument ordering, and might be a clue to authors that data they assumed to be available is not.
Argument | Description | Available for type |
---|---|---|
|
Either null or a string reflecting an action taken to a changelist or job. For example," |
|
%archiveList%
|
Filename containing files to be pulled | pull-archive
|
|
Command argument count. |
all except archive |
|
Command argument string. |
all except archive |
|
Command argument string that contains the command arguments as a percent-encoded comma-separated list. |
all except archive |
|
The number of the changelist being submitted. The abbreviated
form A A |
|
|
The root path of files submitted. |
|
|
Triggering user’s client workspace name. |
all |
|
Client’s current working directory. |
all except archive |
|
Hostname of the user’s workstation (even if connected through a proxy, broker, replica, or an edge server.) |
all |
|
The IP address of the user’s workstation (even if connected through a proxy, broker, replica, or an edge server.) |
all |
|
The name of the user’s client application. For example, P4V, P4Win |
all |
|
The version of the user’s client application. |
all |
|
Command name. |
all except archive |
%depotName%
|
The graph depot in which the repo resides. |
|
%email%
|
The user's email address. See Triggering for multi-factor authentication (MFA). |
|
|
Path of archive file based on depot’s |
|
|
First new changelist number. |
|
|
Path to temporary form specification file. To modify the form
from an |
|
|
Name of form (for instance, a branch name or a changelist number). |
|
|
Type of form (for instance, |
|
%fullname%
|
The user's fullname. See Triggering for multi-factor authentication (MFA). |
|
|
List of groups to which the user belongs, space-separated. |
all except archive |
%host%
|
The IP address of the host of the user. See Triggering for multi-factor authentication (MFA). |
|
|
A broker or proxy is present. |
all except archive |
|
A string of job numbers, expanded to one argument for each job
number specified on a |
|
|
Last new changelist number. |
|
|
One of |
all except archive |
|
Error number and text. |
all except archive |
|
A user-specified value that specifies the number of milliseconds for the longest permissible database lock. If this variable is set, it means the user has overridden the group setting for this value. |
all except archive |
|
A user-specified value that specifies the amount of data buffered during command execution. If this variable is set, it means the user has overridden the group setting for this value. |
all except archive |
|
A user-specified value that specifies the maximum number of rows scanned in a single operation. If this variable is set, it means the user has overridden the group setting for this value. |
all except archive |
%method%
|
The authentication method from list-methods (may be set to "unknown"). See Triggering for multi-factor authentication (MFA). | |
%newValue%
|
See Triggering with depots of type graph. | graph-push-reference
|
|
If a changelist is renumbered on submit, this variable contains the old changelist number. |
|
%oldValue%
|
See Triggering with depots of type graph. | graph-push-reference
|
|
Operation: |
|
|
If the command was sent through a proxy, broker, replica, or
edge server, the hostname of the proxy, broker, replica, or edge
server. (If the command was sent directly,
|
all |
|
If the command was sent through a proxy, broker, replica, or
edge server, the IP address of the proxy, broker, replica, or
edge server. (If the command was sent directly,
|
all |
|
The host port to which the client connects. If the client
connects to the server through an intermediary, this will hold
the port number of the intermediary. If there’s no intermediary,
this will hold the same value as the |
auth-check-sso (client-side script only) |
%pusher%
|
The user credited with the push. See Triggering with depots of type graph. |
|
|
A double quote character. |
all |
%reference%
|
See Triggering with depots of type graph. |
|
%refFlags%
|
||
%refType%
|
||
%repo%
|
The repo, which has |
|
%repoName%
|
The name of the repo. See Triggering with depots of type graph. |
|
|
Revision of archive file |
|
%scheme%
|
The authentication scheme set by init-auth (can be set to "unknown"). See See Triggering for multi-factor authentication (MFA). | auth-init-2fa
|
|
The IP address and port of the
Helix Core server,
passable only in the context of a client-side script specified by
|
auth-check-sso (client-side script only) |
|
Hostname of the Helix Core server. |
all |
|
The value of the
Helix Core server’s
|
all |
|
The IP address of the server. |
all |
|
The value of the
Helix Core server’s
|
all |
|
The transport, IP address and port of the
Helix Core server, in
the format
prefix can be one of |
all |
|
The |
all |
|
A string specifying the role of the server. One of the following:
|
all except archive |
|
Version string for the server that terminated if the command
exited early. Reason for termination is given in
|
all except archive |
|
Expanded to the spec string of the form in question. |
|
%standbyserverid% | Expands to the serverID of the standby before failover | failed-over |
%standbyserverport% | expands to the P4PORT of the standby before failover | failed-over |
|
If this is not a distributed installation,
In a distributed installation, for any change trigger:
If there is a forwarding replica between the commit server and
the edge server, then See |
Not available for |
|
The value of |
|
|
The reason for early termination. This might be one of the following:
See also |
all except archive |
%token%
|
The stashed token from the last init-auth (can be empty). See See Triggering for multi-factor authentication (MFA). | auth-init-2fa
|
%triggerdir%
|
Pull.trigger.dir used for tmp files for Triggers for external file transfer | edge-content
|
|
Command to execute when trigger is fired. Last field of trigger definition. Set only when you run a script from the depot. |
all except archive |
|
Third field in trigger definition. Its meaning varies with the trigger type. For a change-submit trigger, it is the path for which the trigger is expected to match. For a form-out trigger, it might be the form type to which the trigger is expected to apply. See the description of the trigger types for more information on the meaning of this field. |
all except archive |
|
Trigger name: first field from trigger definition. Set only when you run a script from the depot. |
all except archive |
|
Trigger type: second field in trigger definition. Set only when you run a script from the depot. |
all except archive |
|
Helix server username of the triggering user. |
all |
Your search for returned result(s).