<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:support@ActiveState.com" /> </head> <body> <ul id="index"> <li><a href="#NAME">NAME</a></li> <li><a href="#VERSION">VERSION</a></li> <li><a href="#SYNOPSIS">SYNOPSIS</a></li> <li><a href="#DESCRIPTION">DESCRIPTION</a> <ul> <li><a href="#Overview">Overview</a></li> <li><a href="#Concepts">Concepts</a></li> </ul> </li> <li><a href="#ARGUMENTS">ARGUMENTS</a> <ul> <li><a href="#h--man">-h|-man</a></li> </ul> </li> <li><a href="#RETURN-STATUS">RETURN STATUS</a></li> </ul> <h1 id="NAME">NAME</h1> <p>JobIncrement.pl - Trigger to increment jobs with custom names.</p> <h1 id="VERSION">VERSION</h1> <p>1.0.0</p> <h1 id="SYNOPSIS">SYNOPSIS</h1> <p>Enable this as a form-in trigger on the job form, for example:</p> <ul> <p>Triggers:</p> <ul> <p><code>JobIncrement form-in job "/p4/common/bin/triggers/JobIncrement.pl %formfile%"</code></p> </ul> </ul> <p>OR</p> <p><code><span class="variable">JobIncrement</span><span class="operator">.</span><span class="variable">pl</span> <span class="operator">{-</span><span class="variable">h</span><span class="operator">|-</span><span class="variable">man</span><span class="operator">}</span> </code></p> <h1 id="DESCRIPTION">DESCRIPTION</h1> <h2 id="Overview">Overview</h2> <p>The default job naming convention with Perforce Jobs has an auto-increment feature, so that if you create job with a 'Job:' field value of 'new', it will be changed to jobNNNNNN, with the six-digit value being automatically incremented.</p> <p>Perforce jobs also support custom job naming, e.g. to name jobs PROJX-123, where the name itself is more meaningful. But if you use custom job names, you forego the convenience of automatic generation of a new job number. Now typically, if the default job naming feature isn't used, it's because new issues originate jn an external issue tracking, so there's no need for incrementing by Perforce; the custom job names just mirror the value in the external system.</p> <p>This script is aims to make it easier to use custom job names with Perforce even when there is no external issue tracker integration, by providing the ability to generate new job names automatically.</p> <h2 id="Concepts">Concepts</h2> <ol> <li><p>Job Prefix</p> <p>The 'Project:' field in the Jobspec has a 'select' field with pre-defined values for project names. Projects desiring to use custom jobs names will define a counter named JobPrefix-<project_name>, with the value being a tag name, a short form of the project name, to be used as a prefix for job names. For example, a project named joe_schmoe-wicked-good-thing might have a prefix of WGT. Jobs will be named WGT-1, WGT-2, etc. By convention, job prefixes are comprised only of uppercase letters, matching the pattern ^[A-Z]$. No spaces, commas, dashes, underbars, etc. allowed. (There is no mechanicm for mechanical enforcement of this convention, nor none needed, as tags are defined and created by Perforce Admins).</p> <p>To define a prefix for a project, an admin define a value for the appropriate counter, e.g. by doing:</p> <p><code>p4 counter JobPrefix-some-cool-project SCT</code></p> </li> <li><p>High Number Counter</p> <p>For projects with defined tags, there will also be a high number counter tracking the highest numbered job with a give prefix. This counter is created automatically and maintained by this script.</p> </li> <li><p>JobIncrement trigger (this script).</p> <p>This trigger script fires as a 'form-in' trigger on job forms, i.e. it fires on jobs that are on their way into the server. If 'Job:' field value is 'new' and the 'Project:' field value has an associated JobPrefix counter, then the name of the job is determined and set by incrementing the High Number counter, ultimately replacing the value 'new' with something like SCT-201 before it ever gets to the server. If no High Number counter exists for the project, it gets set to '1'.</p> </li> </ol> <h1 id="ARGUMENTS">ARGUMENTS</h1> <h2 id="h--man">-h|-man</h2> <p>Display a usage message. The -h display a short synopsis only, while -man displays this message.</p> <h1 id="RETURN-STATUS">RETURN STATUS</h1> <p>Zero indicates normal completion, Non-Zero indicates an error.</p> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 23314 | matt_peterson | integrate sdp version 23041 | ||
//guest/perforce_software/sdp/main/doc/JobIncrement.pl.html | |||||
#1 | 22185 | C. Thomas Tyler |
Released SDP 2017.2.22177 (2017/05/17). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
//guest/perforce_software/sdp/dev/doc/JobIncrement.pl.html | |||||
#1 | 21912 | C. Thomas Tyler |
Added 'JobIncrement' trigger script to simplify use of custom Perforce job names (i.e. not following the default jobNNNNNN convention) when not integrated with an external defect/issue tracker. This will be used by The Workshop, but seems reasonable to include in the SDP as some customers might find it helpful. |