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

Technote (FAQ)


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

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational ClearQuest
Designer - Hooks

Software version:

7.1.2, 7.1.2.3, 7.1.2.5, 7.1.2.6

Operating system(s):

Windows

Reference #:

1641301

Modified date:

2014-06-26

Translate my page

Machine Translation

Content navigation