p4 jobs
List jobs known to the Helix Core Server.
Syntax
p4 [g-opts] jobs [-e jobview] [-i -l -r] [-m max] [file[rev] ...]
p4 [g-opts] jobs -R
Description
When called without any arguments, p4 jobs
lists all
jobs stored in
Helix Server. You
can limit the output of the command by specifying various criteria with
options and arguments. If you specify a file pattern, the jobs listed
will be limited to those linked to changelists affecting particular
files. The -e
option can be used to further limit the listed
jobs to jobs containing certain words.
Jobs are listed in alphanumeric order (or, if you use the
-r
option, in reverse alphanumeric order) by name, one job
per line. The format of each line is:
jobname on date by user *status* description
The description is limited to the first 31 characters, unless the
-l
(long) option is used.
If any of the date
, user
, status
,
or description
fields have been removed by the
Helix Server
superuser with p4
jobspec
, the corresponding value will be missing
from each job’s output.
To limit the list of jobs to those that have been fixed by changelists
that affected particular files, use p4 jobs
filespec
. The files or file patterns provided can
contain revision specifiers or a revision range.
Options
|
List only those jobs that match the criteria specified by jobview. See Job Views. |
|
Include jobs fixed by changelists that affect files integrated into the named files. |
|
Output the full description of each job. |
|
Include only the first |
|
Display jobs in reverse alphabetical order by job name. |
|
Rebuild the job table and re-index each job. |
|
See Global options. |
Usage Notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
Yes |
Yes |
available to an operator user |
The command returns no output if there is no object to report on.
Job Views
Use p4 jobs -e jobview
to limit the list of
jobs to those that contain particular words. You can specify that the
search terms be matched only in particular fields, or anywhere in the
text of the job. You can use job views to match jobs by values in date
fields, though there are fewer options for dates than there are for text.
Job fields of type bulk
are not indexed for searching.
Text matching is case-insensitive. All alphanumeric strings (including words including embedded punctuation) separated by whitespace are indexed as words.
The job view '
can be used to find jobs that
contain the complete set of word1 through wordN. word1
word2
... wordN
'
Examples:
-
p4 jobs -e "ReportedDate=2018/09/14 OwnedBy=mgaria FixVerifiedBy=jsmith"
-
p4 jobs -e "ReportedDate=2018/09/14 mgaria jsmith"
- p4 jobs -e "25* path QA closed job004* 2014* limit*"
To find jobs that contain all of the terms (boolean AND), separate the terms with the ampersand (&) or a space character.
To find jobs that contain any of the terms (boolean OR), separate the terms with the “|” character.
Boolean operator precedence | |
---|---|
highest | whatever is in parentheses () |
& for AND | |
| for OR | |
lowest | space for AND |
Search results can be narrowed by matching values within specific fields
with the job view syntax
"
".
The fieldname
=value
value
must be a single token, including both
alphanumeric characters and punctuation.
The wildcard "*
" allows for partial word matches. The job
view "
" matches
"fieldname
=string*string
", "stringy
", "stringlike
",
and so on.
Date fields can be matched by expressing the job view date as
or
yyyy
/mm
/dd
.
If a specific time is not provided, the equality operator
(yyyy
/mm
/dd
:hh
:mm
:ss
=
) matches the entire day.
The usual comparison operators (=
, >
,
<
, >=
, and <=
) are
available.
Additionally, you can use the NOT operator (^
) to negate
the sense of some comparisons. (See Limitations below for details).
Regular expression matching is supported by the regular expression
matching operator (~=
).
To search for words containing characters that are job search expression
operators, escape the characters with a backslash (\
)
character. To match the backslash character, escape it with an additional
backlash (\\
).
The behavior of these operators depends on the type of job field you’re comparing against:
Field Type | Use of Comparison Operators in Job Views |
---|---|
|
The equality operator ( The relational operators perform comparisons in ASCII order. |
|
The equality operator ( The relational operators are of limited use here, because they match the job if any word in the specified field matches the provided value. For example, if a job has a |
|
As for field type |
|
The equality operator ( |
|
Dates are matched chronologically. If a specific time is not
provided, the operators |
If you’re not sure of a field’s type, run p4 jobspec
-o, which
outputs the job specification used at your site. The p4 jobspec
field called
Fields:
contains the job fields' names and datatypes. See
p4 jobspec
for a
discussion of the different field types.
Other Usage Notes
- The
p4 user
form has aJobView:
field that allows a job view to be linked to a particular user. After a user enters a job view into this field, any changelists he creates automatically list jobs that match the job view in this field. The jobs that are fixed by the changelist can be left in the form, and the jobs that are not should be deleted. - p4 jobs sorts its output alphanumerically by job name, which also happens to be the chronological order in which the jobs were entered. If you use job names other than the standard Helix Server names, this ordering may not help much.
- The
-m max
-r
construct displays the lastmax
jobs in alphanumeric order, not themax
most recent jobs, but if you are using the default Helix Server job naming scheme (jobs numbered likejob001394
), alphanumeric job order is identical to order by entry date. - You can use the
*
wildcard to determine if a text field contains a value or not by checking for the job view "
"; any non-null value forfield
=*field
matches. - When querying for jobs using the
-e jobview
option, be aware of your operating system and command shell’s behavior for parsing, quoting, and escaping special characters, particularly when using wildcards, logical operators, and parentheses.
Limitations
- Job views cannot be used to search for jobs containing null-valued fields. In other words, if a field has been deleted from an existing job, then the field is not indexed, and there is no job view that matches this "deleted field" value.
- The job view NOT operator (
^
) can be used only after an AND within the job view. Thus, the job views "gui ^name=joe
" and "gui&^name=joe
" are valid, while the job views "gui|^name=joe
" and "^name=joe
" are not. -
The
*
wildcard is a useful way of getting around both of these limitations.For instance, to obtain all jobs without the string "
unwanted
", query for 'job=* ^unwanted
". All jobs will be selected by the first portion of the job view and logically ANDed with all jobs NOT containing the string "unwanted".Likewise, because the job view "
" matches any non-null value forfield
=*field
, (and thejob
field can be assumed not to be null), you can search for jobs with null-valued fields with "job=* ^
"field
=* - You cannot currently search on space-delimited fields with
conditionals. For example, instead of using
p4 jobs -e "field=word1 word2"
, you must usep4 jobs -e "field=word1 field=word2"
.
Examples
|
List all jobs attached to changelists that include revisions of
|
|
List all jobs attached to changelists that include revisions of
|
|
List all jobs that contain the word |
|
List all jobs that contain the word |
|
List all jobs that contain the word |
|
List all jobs containing the word " |
|
List all jobs referring to |
|
List all jobs not containing the word |
|
List all jobs that contain the word |
|
List all jobs that have the word |
Related Commands
To create or edit an existing job |
|
To attach a job to a particular changelist, indicating that the job is fixed by that changelist |
|
To list all jobs and changelists that have been linked together |
|
To view all the information about a particular changelist, including the jobs linked to the changelist |
|
To change the format of the jobs used at your site (superuser only) |
|
To read information about the format of jobs used on your site (any user) |
|
To set a default job view that includes jobs matching the job view in all new changelists |