IBM Support

Disallowing modification of record in a Closed state in Rational ClearQuest

Technote (FAQ)


How do you use a hook to disallow modification of record in a Closed state in IBM Rational ClearQuest?


You want to allow modifications of records in other states and not in Closed state. Closed records are not monitored for updates.


  1. Login to ClearQuest with the role Admin.

  2. Click on Record Types-Go to any Record- States and Actions - Actions.

  3. Click on Modify action.

  4. Under the Validation Column (row should be "modify"), wrtie the below Hook code

    The Record Type is Defect in this case.

    sub Defect_Validation {
       my($actionname, $actiontype) = @_;
       my $result;
    $CQSession = $entity->GetSession();
    $StateName = $entity->GetFieldValue("State")->GetValue();
    if ($StateName eq "Closed")
    $result = "You can not modify a Closed record, please revert it back. To be able to do so, please re-open the record.";
       return $result;

    This hook code will not allow to modify a "Closed" record. You can re-open the record to be able to modify.

  5. Save the work.

  6. Perform "Validation" and check if you see any errors.
    If no errors, perform a "Test Work"

  7. Verify in the Test Database, if it is working as expected.

  8. Once verified in the Test DB, checkin the Schema and Upgrade the "Database".

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Document information

More support for: Rational ClearQuest
Designer - Hooks

Software version: 7.0, 7.0.1, 7.1,, 8.0

Operating system(s): Windows

Reference #: 1637761

Modified date: 28 May 2013

Translate this page: