Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
I have an applucation based on organizations. Each organization unit has its own things. I am trying to add alerts on things, but I cannot retrieve the alerts only related to my organization. When I call QueryAlertSummary service on AlertFunctions ressource I get the global list of alerts including those from things not related to the organization unit I am logged in.
Does anybody know if there is another service available?
So you are saying that within the context of an Organization you are executing this call and retrieve Alerts for ALL Things vs. filtered by Organization correct?
This is because this information is in a 'regular stream'. You'll need to create a wrapping service that filters the source to return the appropriate set based on a User's visible entities.
That's what I suspected...
So, in order to get the alert summary from unit organization, I need to call GetAlertSummary service on each thing and make a union of all results.
Or I can also use the AlertFunctions ressource and parse the result to test each row.
I don't know which way will be the more efficient. I think I'll take the first option as it allows me more flexibility, as I am also using hierarchy with networks, I'll be able to build alert list from a specific level.
Thanks Pai for your help.
Fabien
Since it is in a regular stream, you can even use QueryStreamEntriesWithData and pass in a Query right away.
Hi Fabien Serre,
In case you did not manage to solve the issue, I wanted to let know that Resources["AlertFunctions"].QueryAlertSummary() does filter the result based on the visibility permissions. In case that does not happen you definitely missed something when you configured the permissions.
Make sure you set the proper Organization on the thing (machine) visibility and also make sure the current user is part of that Organization.
The Alert Summery is not persisted in a regular stream so you cannot query it.