IBM Support

How to get the Full Name in drop-down fields in ClearQuest using perl hook

Question & Answer


How do you write Perl code in IBM Rational ClearQuest to get the Full Name to appear in the drop-down fields such as "Owner" or "Assignee"?


You would like to identify a user with the full name rather than the loginID for a good readability factor and easier access.



Note: You may have more than one users with the same Full Name and they are Active ClearQuest users. For Example - two users have the same Full Name and both are active; two same Full Name will appear in the Drop-Down box. To resolve these kind of conflicts you can think about the below solution-

Make sure you don't have same Full Names. Add some extra String at the end of the full name to make a difference between two names.
Further, you can check if any Full Name is already available in ClearQuest using this tech note-

  1. Login to IBM Rational ClearQuest Designer

  2. Check out the Schema

  3. Click Record Types > Record > Fields

  4. Create a new field Assignee or Owner of a "Short_String" type

    Note: Corresponding field on the form should be a drop-down field.

  5. Click Choice List > Scripts > Perl

  6. Add the following hook code

    Note: In this example, field is Assignee


    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.

    sub assignee_ChoiceList {
       my($fieldname) = @_;
       my @choices;
     $CQSession = $entity->GetSession();
    $queryDefObj = $CQSession->BuildQuery("users");

    $operator = $queryDefObj->BuildFilterOperator($CQPerlExt::CQ_COMP_OP_EQ);
    $operator->BuildFilter("is_active",$CQPerlExt::CQ_COMP_OP_EQ,[ "1" ]);

    $resultSetObj = $CQSession->BuildResultSet($queryDefObj);

    while ($resultSetObj->MoveNext() == $CQPerlExt::CQ_SUCCESS) {
       return @choices;


    Note: This code will place Full Name of the ClearQuest Active users in the choice list of the field.

  7. Save

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

  9. Verify in the Test Database

  10. Check in the Schema

  11. Upgrade the Database

[{"Product":{"code":"SSSH5A","label":"Rational ClearQuest"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"Designer - Hooks","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.1.2;;;","Edition":""}]

Document Information

Modified date:
16 June 2018