The Presets field

All fields with a field type of anything other than optional require default values. To assign a default value to a field, create a line in the jobspec form under Presets consisting of the field name to which you’re assigning the default value. Any single-line string can be used as a default value.

The following variables are available for use as default values.

Variable Value

$user

The Helix Server user creating the job, as specified by the P4USER environment variable, or as overridden with p4 -u username job.

$now

The date and time at the moment the job is saved.

$blank

The text <enter description here>.

When users enter jobs, any fields in your jobspec with a preset of $blank must be filled in by the user before the job is added to the system.

The lines in the Presets field for the standard jobs template are:

Presets:
      Status open
      User $user
      Date $now
      Description $blank

Using Presets: to change default fix status

The Presets: entry for the job status field (field 102) has a special syntax for providing a default fix status for p4 fix, p4 change -s, and p4 submit -s.

If completed is in a select setting in the Values field of p4 jobspec, and if we want the default fix status to be completed, we can use /completed as follows:

Presets:
      Status open,fix/completed

If we wanted to change the default behavior of p4 fix, p4 change, and p4 submit to leave job status unchanged after fixing a job or submitting a changelist, we could use /same as follows:

Presets:
      Status open,fix/same