This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL query in PowerShell script Trigger Action is not returning a value when triggered by SW, but it DOES when you run the script on the SW application server itself

The submit a ticket portal was not working, kept giving me a "Your ticket was unable to be submitted at this time due to an error. Please try again. We apologize for any inconvenience." error and would never submit, soooo....

The attached script is triggered by an alert in SW. Testing the trigger produces a text file, which it's supposed to do. However, for some reason, a part of the text file is supposed to include a TeamID value, and it never does. I've spent the better part of about a week trying to figure out why this one part of the PowerShell script (line 16) is not returning a value when triggered by SW, but it DOES when you run the script on our SW application server itself.

The trigger action ("Execute an external program") command is the following:

  • powershell E:\Scripts\TicketCreator\CreateCherwellEvent1.ps1 -team 'NOC'

So, the trigger does run the PS script, but for some reason it's not executing the SQL query, but only if you run it through SW; works perfectly in a regular PowerShell window on the app server.

Please help emoticons_sad.png

CreateCherwellEvent1.ps1