7 Replies Latest reply on May 5, 2016 9:41 PM by tdanner

    Alert CRUD operations

    Mark Roberts

      Hi,

       

      I know it is possible to perform an update to an alert via the SDK to acknowledge an alert. I am keen to know what is possible for other updates to the alerts area.

       

      Specifically I am looking at performing the following workflow:

       

      Orion Alert Raised

                \/

      Integrates to 3rd Party Helpdesk to Auto create ticket

                \/

      Ticketing application upon creation of ticket updates the Orion Alert Notes column with its new Ticket Reference ID

                \/

      Upon Reset this Ticket Reference ID is passed to the ticketing application to allow it to associate the updated information to the existing case

       

      Powershell is preferred codebase

       

      thanks for any help.

        • Re: Alert CRUD operations
          tdanner

          To update the notes in an alert, you can use a PowerShell command like this:

           

          Add-PSSnapin SwisSnapin

          $swis = Connect-Swis

          $uri = 'swis://IAF-VM-UNI-07./Orion/Orion.AlertStatus/AlertDefID=BAD58621-C58A-46AB-A74D-6C3C202BBF3B,ActiveObject="5"'

          $newnote = "This is my new note text."

          Set-SwisObject $swis $uri @{Notes=$newnote}

           

          This will replace any note on the alert. If you want to append to the note, you will need to query for the previous value and concatenate them, like this:

           

          $alert = Get-SwisObject $uri

          $newnote = $alert.Notes + "`nThis is my new note text."

          Set-SwisObject $swis $uri @{Notes=$newnote}