{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6612","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6612/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6612/comments","events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6612/events","html_url":"https://github.com/civicrm/civicrm-core/pull/6612","id":103592134,"number":6612,"title":"'Contains' operation for searching multi-select custom fields with the API.","user":{"login":"johanv","id":586145,"avatar_url":"https://avatars.githubusercontent.com/u/586145?v=3","gravatar_id":"","url":"https://api.github.com/users/johanv","html_url":"https://github.com/johanv","followers_url":"https://api.github.com/users/johanv/followers","following_url":"https://api.github.com/users/johanv/following{/other_user}","gists_url":"https://api.github.com/users/johanv/gists{/gist_id}","starred_url":"https://api.github.com/users/johanv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanv/subscriptions","organizations_url":"https://api.github.com/users/johanv/orgs","repos_url":"https://api.github.com/users/johanv/repos","events_url":"https://api.github.com/users/johanv/events{/privacy}","received_events_url":"https://api.github.com/users/johanv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/civicrm/civicrm-core/labels/master","name":"master","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"totten","id":1336047,"avatar_url":"https://avatars.githubusercontent.com/u/1336047?v=3","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-08-27T20:48:09Z","updated_at":"2015-08-28T14:16:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6612","html_url":"https://github.com/civicrm/civicrm-core/pull/6612","diff_url":"https://github.com/civicrm/civicrm-core/pull/6612.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/6612.patch"},"body":"I had to rebase this on my PR for CRM-17101 (#6611).\r\n\r\nI implemented a 'contains' operator for searching values in multi-select custom fields.\r\nI'm not sure whether this is a useful enhancement for the API, I'll leave that to you. It covers my use case, so I might as well upload it :-)\n\n---\n\n * [CRM-17101: civicrm_api3_basic_get does not work for SQL operators on custom fields.](https://issues.civicrm.org/jira/browse/CRM-17101)"},"comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments/135784983","html_url":"https://github.com/civicrm/civicrm-core/pull/6612#issuecomment-135784983","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6612","id":135784983,"user":{"login":"colemanw","id":2874912,"avatar_url":"https://avatars.githubusercontent.com/u/2874912?v=3","gravatar_id":"","url":"https://api.github.com/users/colemanw","html_url":"https://github.com/colemanw","followers_url":"https://api.github.com/users/colemanw/followers","following_url":"https://api.github.com/users/colemanw/following{/other_user}","gists_url":"https://api.github.com/users/colemanw/gists{/gist_id}","starred_url":"https://api.github.com/users/colemanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemanw/subscriptions","organizations_url":"https://api.github.com/users/colemanw/orgs","repos_url":"https://api.github.com/users/colemanw/repos","events_url":"https://api.github.com/users/colemanw/events{/privacy}","received_events_url":"https://api.github.com/users/colemanw/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T14:16:44Z","updated_at":"2015-08-28T14:16:44Z","body":"One question I have about this is what happens if you try to use the CONTAINS operator on a non-multivalued field?\r\nI'm guessing it won't work. Also, from your description, the LIKE operator won't work on a multivalued field.\r\nSo just a thought, but instead of inventing a new sql verb, maybe we could just get the LIKE operator to work correctly for multivalued fields using this code when appropriate?"}}