The Session object is the entry point for accessing Rational® ClearQuest® user databases. For ClearQuest hooks, a Session object is created automatically when a user logs on to the database, and is available through the Entity object. If you are writing an external application, you must create a Session object and use it to log on to a database.
set currentSession = GetSession
VBScript
hooks implicitly associate the Entity object with the current record.$session=$entity->GetSession();
set currentSession = CreateObject("CLEARQUEST.SESSION")
set adminSession = CreateObject("CLEARQUEST.ADMINSESSION")
$currentSession = CQSession::Build();
$currentAdminSession= CQAdminSession::Build();
When you are done with the object, destroy it:
CQSession::Unbuild($currentSession);
CQAdminSession::Unbuild($currentAdminSession);