Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2026.1

# p4 triggers

Create or display a list of scripts to be run conditionally when certain operations are performed, such as changelist submitted, form updated, journal rotated, and more.

## Syntax

    p4 [g-opts] triggers
    p4 [g-opts] triggers -o
    p4 [g-opts] triggers -i

Syntax and naming conventions

## Description

P4 triggers are user-written scripts or programs that are called by a P4 Server when certain operations are performed. Among the possible use cases are changelist submission, changes to forms, integration with an external authentication or archive mechanism, push or fetch of remote depot content, failover, failback, server response monitoring, and enforcement of command policies, such as when a user attempts to log in or change a password.

If the script returns a value of `0`, the operation continues. If the script returns any other value, the operation fails.

The `p4 triggers` command includes three variants:

- With no options specified, the command invokes the default editor to allow the user to specify one or more trigger definitions.
- The `-i` option specifies that the user use standard input to specify one or more trigger definitions.
- The `-o` option displays the trigger definitions currently stored in the trigger table.

A trigger definition contains four fields that specify the name of the trigger, the type of event that should trigger the execution of the script, the location of the script, and other trigger type-dependent information. When the condition specified in a trigger definition is satisfied, the associated script or program is executed.

See "Using triggers to customize behavior" in the P4 Server Administration Documentation.

## Options

Option | Description
--- | ---
`-i` | Read the trigger table from standard input without invoking the editor.
`-o` | Write the trigger table to standard output without invoking the editor.
`g-opts` | See Global options.

## Usage Notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
N/A | N/A | `super`

## Related commands

To obtain information about the changelist being submitted | `p4 describe` `p4 opened`
To aid daemon creation | `p4 review` `p4 reviews` `p4 counter` `p4 counters` `p4 user`

Your search for returned results