How to update custom multi-user field in Zoho Projects?

How to update custom multi-user field in Zoho Projects?

I'm trying to update custom multi-user fields in Zoho Projects via a Deluge function in CRM.

The code I have so far is below. It works for updating standard project fields and single-line custom fields, but it does not work to update multi-user fields. I assume the problem is the format I'm passing the multi-user data in. 

I've been looking for answers and found two sources for multi-user fields in Projects. The first: https://www.zoho.com/projects/help/rest-api/projects-api.html#update-project seems to contradict the second: https://projects.zoho.com/api-docs#field-types

I'd love some help!


  1. void automation.updateProjectExample()
  2. {
  3.     // Get custom fields for the portal
  4.     fieldsResponse = invokeurl
  5.     [
  6.         url: "https://projectsapi.zohocloud.ca/restapi/portal/your_portal_name/projects/customfields/"
  7.         type: GET
  8.         connection: "your_connection_name"
  9.     ];
  10.     info fieldsResponse;

  11.     // Map field names to field IDs
  12.     fieldMap = map();
  13.     for each field in fieldsResponse.get("project_custom_fields")
  14.     {
  15.         fieldName = field.get("field_name");
  16.         fieldID = field.get("field_id");
  17.         fieldMap.put(fieldName, fieldID);
  18.     }
  19.     info fieldMap;

  20.     // Get related instructors from a CRM deal
  21.     dealId = 1234567890;  // Example Deal ID
  22.     deal = zoho.crm.getRecordById("Deals", dealId);
  23.     dealName = deal.get("Deal_Name");
  24.     projectId = 9876543210; // Example Project ID

  25.     instructors = zoho.crm.getRelatedRecords("Instructors", "Deals", dealId);

  26.     instructorOneUsers = list();
  27.     instructorTwoUsers = list();
  28.     customizerUsers = list();

  29.     // Organize users by role
  30.     for each instructor in instructors
  31.     {
  32.         role = instructor.get("Role");
  33.         zpuid = instructor.get("Zoho_Projects_user_ID"); // The instructor's Zoho Projects user id is stored in this field 

  34.         if(role == "Instructor one")
  35.         {
  36.             instructorOneUsers.add(zpuid);
  37.         }
  38.         else if(role == "Instructor two")
  39.         {
  40.             instructorTwoUsers.add(zpuid);
  41.         }
  42.         else if(role == "Customizer")
  43.         {
  44.             customizerUsers.add(zpuid);
  45.         }
  46.     }

  47.     // Build payload for updating the project. Updating these standard fields works. 
  48.     payload = Map();
  49.     payload.put("description", "Updated via Deluge script");
  50.     payload.put("start_date","11-01-2025");
  51.     payload.put("end_date","11-01-2026");

  52.     // Example of updating a single-line custom field. This works.
  53.     payload.put("UDF_CHAR20", "Sample text for testing");

  54.     // Example of updating a multi-user custom field (Instructor One). This does not work.
  55.     payload.put("UDF_MULTIUSER1", "4320000000540073"); // Replace with actual user IDs

  56.     // Make the API call to update the project
  57.     resp = invokeurl
  58.     [
  59.         url: "https://projectsapi.zohocloud.ca/restapi/portal/your_portal_name/projects/" + projectId + "/"
  60.         type: POST
  61.         parameters: payload
  62.         connection: "your_connection_name"
  63.     ];

  64.     info resp;
  65. }