Automation: Create a Project Automatically and Assign Project Owner Based on Account Owner
I have found a function that automatically creates a project when triggered, however the issue is that i want not only to create the project but also assign the project owner or tasks owner to the same user who is responsible for that account in the CRM.
i have tried ( responsible_person - owner_id - owner ) when i do ( Save and Execute ) it gave me ( Function executed successfully )
However the project is created but the project owner is by default my user who created the project same goes for the project tasks owner, meaning that even when i assign an owner ID it seems like the script just ignore it and create the project without assigning the project owner based on the code.
Here is the code:
- createMap = Map();
- createMap.put("name",ProjName);
- createMap.put("responsible_person",TaskOnwer);
- createMap.put("description",Description);
- createMap.put("template_id",TemplateID);
- //custom fields
- //end of custom fields
- response = zoho.projects.createProject(PortalName,createMap,"relateproject");
- info response;
- mp = Map();
- mp.put("name",ProjName);
- datalist = List();
- datalist.add(mp);
- datamp = Map();
- datamp.put("data",datalist);
- resp2 = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v2/Accounts/" + id + "/Zoho_Projects/" + response.getJSON("projects").getJSON("id")
- type :POST
- parameters:datamp.toString()
- connection:"XXXXXXXX"
- ];
- info resp2;
Any clarification would be helpful as if what i want to do is even achievable!