4 Replies Latest reply on Jan 17, 2018 2:05 PM by fserre RSS
    fserre Explorer

    Organizations and Alerts visibility issue


    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?

      • Re: Organizations and Alerts visibility issue
        pchung Collaborator

        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.

          • Re: Organizations and Alerts visibility issue
            fserre Explorer

            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.


          • Re: Organizations and Alerts visibility issue
            stanislav Explorer

            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.