Search code examples
perforcejobs

Edit a job field with P4 cmd (Perforce)


I'm trying to find how to edit a specific job field using p4.exe command line. I tried to watch the output of P4V when I edit one manually, but it give no advice else than:

p4 job -i Job job0001 saved. p4 job -o job0001

I tried many commands like: p4 job -i job0001 filed_name= value , ...

As usual, the doc explain nothing.

Thanks


Solution

  • using the '-i' flag with the 'p4 job' command, allows a job specification to be read in from a file, if you also use the '<' operator.

    For example, I have a standard description, that I want to include in all my jobs, so I run:

    p4 job -o > job file

    to create a file that contains a job spec.

    I then edit this file, so that the 'Description' field contains my description.

    I then run the following:

    bash-3.2$ p4 job -i < jobfile Job job000003 saved.

    Running the following command, shows that 'job000003' contains the description, that I wrote in 'job file':

    bash-3.2$ p4 job -o job000003 # A Perforce Job Specification. # # Job: The job name. 'new' generates a sequenced job number. # Status: Either 'open', 'closed', or 'suspended'. Can be changed. # User: The user who created the job. Can be changed. # Date: The date this specification was last modified. # Description: Comments about the job. Required.

    Job: job000003

    Status: open

    User: jen

    Date: 2015/03/31 12:08:16

    Description: My test job.

    Hope this helps, Jen!