And I want to create an automation to clear the notification on all devices when some of the users click on the notification (using clickAction). What is the trigger for automation? Or can I have a clickAction with two actions (one for opening the application and one for a boolean variable)?
clickAction only controls what view or app is opened when its selected, there is no specific event sent back to HA. You can try to see if the notification clear event gets fired but that will be your easiest indication to clear the notification.
You can also try to see if the notification shows up in the active notification count and then clear based on it not being present.
Can you help me with active notification count?
Or can I have a clickAction with two actions (one for opening the application and one for a boolean variable)?