Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18082

CiviCase API Create ignores custom data


    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
    • Funding Source:
      Contributed Code


      When using the API to create a new Case you can pass in custom data parameters to populate associated custom data groups/fields, but they are completely ignored at the API level.
      see: master@api/v3/Case.php:84
      Only a select group of fields are sent through to the BAO. There is already a todo saying this needs to be cleaned up, but I couldn't find a Jira issue for it.

      I think the best solution is to properly fix the way that parameters are passed into the BAO from the API, but this may cause problems elsewhere if data is being passed directly from a form into the API as it seems to be in some places. In my opinion an interim step would be to add 'custom' with a reasonable default to the newParams list to allow the creation of Cases with their associated custom data while we sort out the rest of that function.

      With a little bit of input on the best approach I'll be happy to submit the patch myself.




            • Assignee:
              saurabh.batra Saurabh Batra
              tobiaslounsbury Tobias Lounsbury
            • Votes:
              0 Vote for this issue
              5 Start watching this issue


              • Created: