ClientContext = GetMy365Context(...); Web web = ctx.Web; List list = web.Lists.GetByTitle("NotifyTest"); User user = ctx.Web.SiteUsers.GetByEmail("someone@example.com");ctx.Load(web);ctx.Load(list);ctx.Load(user);ctx.ExecuteQuery(); AlertCreationInformation aci = new AlertCreationInformation() { AlertFrequency = AlertFrequency.Immediate, AlertType = AlertType.List, AlwaysNotify = true, EventType = AlertEventType.All, DeliveryChannels = AlertDeliveryChannel.Email, Title = "Alert filtered on choice", User = user, AlertTemplateName = "SPAlertTemplateType.GenericList" };
aci.List = list;
aci.Filter = "<Query><Eq><FieldRef Name=\"MyChoiceField\" /><Value Type=\"Text\">MyChoiceValue</Value></Eq></Query>";
web.Alerts.Add(aci);
ctx.ExecuteQuery();
But, I was unable to find any proper documentation on the supported CAML for Filter. E.g. <In> is not supported as well as Type="Choice"
So my question is, what query can I use to filter on a multivalue managed metadata field? So far I have tried using the GUID of the term, the lookup id of the term in the taxonomy hidden list, the text-value of the term, the <contains>-operator, the <eq>-operator but without any luck.
(also posted on https://sharepoint.stackexchange.com/questions/260488/create-list-alert-with-filter-on-managed-metadata-field)