Automation: Create a Project Automatically and Assign Project Owner Based on Account Owner

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: 

  1. createMap = Map();
  2. createMap.put("name",ProjName);
  3. createMap.put("responsible_person",TaskOnwer);
  4. createMap.put("description",Description);
  5. createMap.put("template_id",TemplateID);
  6. //custom fields
  7. //end of custom fields
  8. response = zoho.projects.createProject(PortalName,createMap,"relateproject");
  9. info response;
  10. mp = Map();
  11. mp.put("name",ProjName);
  12. datalist = List();
  13. datalist.add(mp);
  14. datamp = Map();
  15. datamp.put("data",datalist);
  16. resp2 = invokeurl
  17. [
  18. url :"https://www.zohoapis.com/crm/v2/Accounts/" + id + "/Zoho_Projects/" + response.getJSON("projects").getJSON("id")
  19. type :POST
  20. parameters:datamp.toString()
  21. connection:"XXXXXXXX"
  22. ];
  23. info resp2;

Any clarification would be helpful as if what i want to do is even achievable!