Copy Catalog Item name to title field of interactions

Hi Experts,

We are having HP service manager 9.35.

Once a interaction is submitted , the title field is empty we want to copy the title field with the catalog item name selected:

For ex: Applications --> Web Applications --> ERP Application

 so we want to capture the last in hearichey i.e  ERP Application in title field of SD.(interaction)

I tried with placing the script in trigger records of incidents as:

var var1;
var var2;

var cartdetails1 = new SCFile("joinsvcDisplay");
var query1 = "id=\"" record.svcCatalogId "\"";
var res1 = cartdetails1.doSelect(query1);
if (res1 == RC_SUCCESS)
{
var1 = cartdetails1.displayName;
var2 = cartdetails1.zvsrassgn;
print("the selected record found in joinsvcdisplay table");
print("the details are");
print("Catalog item: " var2);
print("Interface info: " cartdetails1.interface_info);
}

record.title = var1;
record.zvsrassgn1 = var2;
record.doSave();

print("the detail after update are");
print("Cart item: " cartdetails2.zitem);

But it is not working & giving me the below result as :

Kindly suggest!!

Title field is still apprearing empty....

Thanks

Neo