We have a function in our CRM that creates a Zoho Project (from a Project Template) when a particular field is updated.
I'd like to try and assign teams to the project at that time but I can't seem to make it work. Is this possible and if so can someone help me to achieve it?
This is our (very dumbed down) code and I would like to add in a line that assigns 2 teams to the project. I've replaced actual data with fake data obviously. Everything works fine and has for years, however I just can't seem to get the field right for assigning the teams to the project.
template_list = {"Project Template 1":"1112223334445556667","Project Template 2":"1112223334445556668","Project Template 3":"1112223334445556669",};
//INVOICE ID WE WANT TO USE
invoice_rec = 1112223334445556666;
//FIELDS FOR PROJECTS
Name = invoice_rec.get("Project_ID"); //This is the project template name
zuid = zoho.crm.getRecordById("users",invoice_rec.get("Owner").get("id")).get("users").get(0).get("zuid");
PortalName = "ourportalname";
type_of_project_for_template = invoice_rec.get("Type_Of_Project");
template_to_use = template_list.get(type_of_project_for_template);
template_id = template_to_use.toString();
dataMap = {"name":Name,"owner":zuid,"template_id":template_id,"teams":"Production Team"};
response = zoho.projects.createProject(PortalName,dataMap);
decoded_data = zoho.encryption.urlDecode(response);
decoded_data_map = decoded_data.toMap();
zoho_project_id = decoded_data_map.get("projects").get(0).get("id").toString();
At this point we update the Invoice in the CRM with the Project ID.
Any help would be amazing as this is driving me crazy!!