Hi @ritzgu
thanks for the suggestion, this is the result which I get with:
// for template Service departmentB
vars.notification["mail_contacts"].groups += "departmentB"
Result: [2021-03-23 10:09:41 +0100] critical/config: Error: Error while evaluating expression: Operator + cannot be applied to values of type 'Array' and 'String'
Also tried:
// for template Service departmentA
vars.notification["mail_contacts"].groups += "departmentA"
// for template Service departmentB
vars.notification["mail_contacts"].groups += "departmentB"
Result:
[2021-03-23 10:12:12 +0100] critical/config: Error: Validation failed for object âxxx!mail-Serviceâ of type âNotificationâ; Attribute âuser_groupsâ: Object âdepartmentAdepartmentBâ of type âUserGroupâ does not exist.
As it seems nothing can be additional added to a array from a Host/Service var-Variable / Array. Or is there syntax for this case?
Its working with: vars.notification["mail_contacts"].groups += [ "departmentB" ]
And changed apply rule to:
apply Notification "mail-service" to Service {
import "mail-service-notification-template"
user_groups += service.vars.notification.mail_contacts.groups
assign where service.vars.notification.mail_contacts.groups
}