How can I associate client account from CRM to a new project using deluge

How can I associate client account from CRM to a new project using deluge

Hi,
I am using zoho one product an i am having a little issue in associating the client account information with the new project using the deluge in custom function when I execute the script it creates the project as is intended to be, but when I check the projects module under CRM account, it is not there as it is not associated with the account and I have to do the association manually. Can anyone help please to make the association automatically?


I am using this script which I got from the gallery:

url = "https://projects.zoho.com/portal/" + PortalName + "/api/private/xml/project/getprojtemplates";
info url;
params = {"authtoken":AuthToken};
res = postUrl(url,params);
templateId = res.executeXPath("/response/result/ProjectDetails/ProjectDetail[ project_name  = '" + Template + "'] /project_id/text()");
info templateId;
params.put("projTitle",ProjectName);
params.put("projDesc",Description);
params.put("templateId",templateId);
resp = postUrl("https://projects.zoho.com/portal/" + PortalName + "/api/private/xml/project/addprojwithtemplate",params);
info resp;