IBM Support

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

Question & Answer


Question

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"?

Cause

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

Answer

Procedure:

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-
http://www-01.ibm.com/support/docview.wss?uid=swg21641562
 
  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
     
    Disclaimer

    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");
    $queryDefObj->BuildField("fullname");

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

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

    while ($resultSetObj->MoveNext() == $CQPerlExt::CQ_SUCCESS) {
    push(@choices,$resultSetObj->GetColumnValue(1));
    }
       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":"BU053","label":"Cloud & Data Platform"},"Component":"Designer - Hooks","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.1.2;7.1.2.3;7.1.2.5;7.1.2.6","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
21 March 2021

UID

swg21641301