Associate changes with change orders

To keep track of work done in response to an engineering change order (ECO), you can do the following:

  • Use attributes and triggers.

To use attributes and triggers, start by associating a version with an ECO. Define ECO as an integer-valued attribute type. For example:

cleartool mkattype –c "bug number associated with change" –vtype integer ECO
Created attribute type "ECO".

Then, define an all-element trigger type, EcoTrigger (see Trigger definition).

Trigger definition

This trigger fires whenever a new version is created and runs a script to attach the ECO attribute.
cleartool mktrtype –element –all –postop checkin \
–c "associate change with bug number" \
–execunix 'Perl /public/scripts/eco.pl' \
–execwin 'ccperl \\neon\scripts\eco.pl' EcoTrigger
Created trigger type "EcoTrigger". 

Trigger action script

$pname = $ENV{’CLEARCASE_XPN’};

print "Enter the bug number associated with this checkin: ";
$bugnum = <STDIN>;
chomp ($bugnum);
$command = "cleartool mkattr ECO $bugnum $pname";

@returnvalue = ‘$command‘;
$rval = join "",@returnvalue;
print "$rval";

exit(0);

When a new version is created, the attribute is attached to the version. For example:

cleartool checkin –c "fixes for 4.0" src.c
Enter the bug number associated with this checkin: 2347 
Created attribute "ECO" on "/vobs/dev/src.c@@/main/2".
Checked in "src.c" version "/main/2".
cleartool describe src.c@@/main/2
version "src.c@@/main/2"
... 
  Attributes:
    ECO = 2347