diff --git a/inventory_provider/db/ims_data.py b/inventory_provider/db/ims_data.py index 66583ae0ca26d2f2258bffa9a3d86c181590ce63..20efd5c1af2846e0cc355b20871dcc5968d35169 100644 --- a/inventory_provider/db/ims_data.py +++ b/inventory_provider/db/ims_data.py @@ -109,18 +109,14 @@ def get_service_types(ds: IMS): def get_customer_service_emails(ds: IMS): customer_contacts = defaultdict(set) + for x in ds.get_filtered_entities( 'customerrelatedcontact', - "contact.plannedworkmail != '' | contact.mail != ''", - CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact'] - ): - customer_contacts[x['customerid']].add(x['contact']['mail']) - for x in ds.get_filtered_entities( - 'customerrelatedcontact', - "contact.troubleticketMail != '' | contact.mail != ''", + "contact.troubleticketMail != ''", CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact'] ): - customer_contacts[x['customerid']].add(x['contact']['mail']) + customer_contacts[x['customerid']].add( + x['contact']['troubleticketMail']) for k, v in customer_contacts.items(): yield k, sorted(list(v))