An Admin can update their job with a new milestone, plus they can choose a team member(s) to get an alert when a milestone is updated.
In the example below, the Admin has gone to their settings page and has said that Kevin should be alerted when the milestone “Site visited” has been activated.
There could be multiple team members which should be alerted but I am only able to notify the “Users:first item”, if I try anything else I get a red error text. I am basically trying to do this: Search for Users Who's 'statusNotification' contains parent groups Order_status
The field on the Data type Notification needs to be a “List of Recipients” not a single Recipient. Check the “This field is a list (multiple entries)” and then you won’t have to use the :first item constraint on your Search for Users.
Now the notification is saving to the database for the correct milestone. However, even when no one should be notified (ie. no user has alerts set for a milestone notification) the database still is populated, is that correct?
I could maybe add an ‘Only when’ condition but I can’t think of what to do, everything I try limits to the current user so other team members don’t get notifications. Besides, I should need to because I am searching for Users who meet the conditions already? I am searching for ALL users who’s statusNotification contain the current Jobs status (or milestone).
PS. I am going to change all mention of ‘Status’ to ‘Milestone’ as it’s simpler and I have used both - not good UX!
Yes you need a condition if you dont want tonpopulate DB if there’s no recipient. And to set that, you will do the same search for user that you have in recipients field and add :count > 0