Skip to main content
Solved

I'm struggling getting automations with powershell,- not running, no errors?

  • October 11, 2024
  • 7 replies
  • 151 views

Forum|alt.badge.img+1

I’m not sure where to turn next to trace this behavior. 

Orchestration server deployed, shows online. Running the powershell app configured to use the same server. 

Exact workflow, we are trying to automate user creation, but have a hybrid environment. Normally we use powershell to create the user and o365 mailbox simultaneously. 

Basic workflow just to see if we can pass the values right now:

  1. When Service request is raised
  2. If subject contains ‘Employee onboarding requests’
  3. A quick line of powershell that should spit out a .csv on the server containing info from the onboarding server

I’m running into two problems. One, out of several attempts at test tickets to see if the automator executes, I’ve only seen it attempt to execute once. That one particular one failed due to the orchestration server being down. Every other test ticket did not create a log entry. 

If i use the ‘test app action’, i get no feedback. The first day i was running this, i did get some errors back regarding my powershell line- but once i fixed them, i get nothing on ‘test app’ button. no errors, no file creation. 

Don’t see any logs on the orchestration serve- one file that looks like it’s mostly just java logs, don’t see anything on the powershell side at a glance. 

Any pointers on what to look at next? Any obvious issues?

Best answer by corey.holden

 

beckyricee wrote:

I'm having difficulty with automations in PowerShell—nothing seems to run, and there are no error messages to guide me. Despite multiple attempts, I can't figure out what's going wrong. Any advice on debugging or troubleshooting PowerShell scripts in such situations would be really helpful.

sss contributions pampanga

 

Update here for What i have learned, may help someone else. 
 

  • Automations not running: This issue appears to be tied to tickets being created with no assignment. Didn’t have onboarding tickets automatically assigned to onboarding team on creation, nor some of our other automations. Making sure that the tickets had some sort of assignment seems to now have every created ticket run the automations as expected. 
     
  • No feedback of orchestration server. This is apparently the default timeout behavior. Could not get to the bottom of why the server was timing out in this case. The server met specs, we saw that it got the command, then the process utilization increased, but then appeared to just lag out. We set up the orchestration server on a different machine and it worked there. 
View original
Did this topic help you find an answer to your question?

7 replies

Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

I would check with the support@freshservice.com 


Forum|alt.badge.img+6
  • Skilled Expert
  • 44 replies
  • October 15, 2024

Here's how you can break it down to figure out what’s happening and get back on track:

1. Double-Check the Trigger

Make sure the workflow is actually firing. It could be something as simple as the ticket subject not exactly matching. If you're using "Employee onboarding requests" as the subject, try making it more flexible by checking if the subject contains that phrase, rather than looking for an exact match. This should make sure it triggers whenever a relevant request comes in.

2. Check the Logs in Freshservice

Freshservice should be logging what's happening with your workflows. Head over to the automation logs in your settings, and see if it’s even attempting to run when you raise those test tickets. If there are no logs, it might mean the workflow isn’t triggering at all, which could point to an issue with how the conditions are set up.

3. Add Error Handling in Your PowerShell Script

To make sure you're catching any errors in your script, you can wrap it in a Try-Catch block so it logs any issues directly. Even if nothing shows up in Freshservice, at least you’ll get some feedback from PowerShell. This might help you figure out why the file isn’t being created as expected.

Here’s a simple way to do that:

Copy code

Try { # Your script here } Catch { Write-Output "Error: $_" }

4. Test App Action Isn't Showing Anything?

If hitting the "Test App Action" doesn’t give you any feedback, that’s super frustrating! Try checking if the orchestration server is even receiving the command. There might be something going on with how it’s communicating with Freshservice—like a firewall, permissions issue, or network glitch. You could also add some extra logging or have the script generate a basic file (like a .txt) just to see if the server is doing anything at all.

5. Try Simplifying the Workflow

You might want to strip down the workflow to its basics for testing. For instance, instead of running the full PowerShell script, start with something simple—like logging a message or creating a basic file. If that works, then you know the automation is triggering properly, and you can start adding back the more complex parts one by one.

6. Orchestration Server Health

Check if the orchestration server itself is healthy and running as expected. Since it went down once, it’s worth making sure it’s fully operational now. Sometimes even small hiccups with server permissions or connectivity can stop scripts from running.

7. Permissions on Both Ends

Make sure the account running your PowerShell script has permission to write files and do everything else it needs to do. Also, ensure the orchestration app in Freshservice has the correct permissions to interact with your PowerShell server.

8. Don’t Forget to Breathe!

Troubleshooting automation issues can be maddening, especially when you're not getting any clear errors to guide you. But try taking it step by step, focusing on one potential issue at a time. You’ll eventually find the missing piece.

If you're still stuck after trying these, it might be a good idea to reach out to Freshservice support. They can help dig deeper into the logs and provide more insight on what's going wrong.


bram.veldhoen
Community Debut
Forum|alt.badge.img+3
  • Community Debut
  • 7 replies
  • October 17, 2024

Just adding to what Daniel already said, contact Freshservice Support. We had this issue as well and they resolved it together with our partner.


  • Community Debut
  • 2 replies
  • October 30, 2024

Ensure that your conditions for triggering the workflow (e.g., the subject containing "Employee onboarding requests") are being met. Test with exact phrases to rule out issues.

Run your PowerShell script directly on the orchestration server to confirm it works outside the automator context. Ensure it generates the .csv file as expected.


beckyricee
Community Debut
Forum|alt.badge.img
  • Community Debut
  • 9 replies
  • January 24, 2025

I'm having difficulty with automations in PowerShell—nothing seems to run, and there are no error messages to guide me. Despite multiple attempts, I can't figure out what's going wrong. Any advice on debugging or troubleshooting PowerShell scripts in such situations would be really helpful.

sss contributions pampanga


Forum|alt.badge.img+1
  • Author
  • Community Debut
  • 1 reply
  • Answer
  • January 29, 2025

 

beckyricee wrote:

I'm having difficulty with automations in PowerShell—nothing seems to run, and there are no error messages to guide me. Despite multiple attempts, I can't figure out what's going wrong. Any advice on debugging or troubleshooting PowerShell scripts in such situations would be really helpful.

sss contributions pampanga

 

Update here for What i have learned, may help someone else. 
 

  • Automations not running: This issue appears to be tied to tickets being created with no assignment. Didn’t have onboarding tickets automatically assigned to onboarding team on creation, nor some of our other automations. Making sure that the tickets had some sort of assignment seems to now have every created ticket run the automations as expected. 
     
  • No feedback of orchestration server. This is apparently the default timeout behavior. Could not get to the bottom of why the server was timing out in this case. The server met specs, we saw that it got the command, then the process utilization increased, but then appeared to just lag out. We set up the orchestration server on a different machine and it worked there. 

Forum|alt.badge.img+6
  • Skilled Expert
  • 44 replies
  • January 30, 2025

Possible Fix: Automations Not Running

Issue: Automations weren’t triggering because tickets were created without an assignment.

Solution:

  1. Check Ticket Assignment

    • Ensure that tickets are assigned to a group or agent upon creation.
    • Go to Admin > Automations and review your automation rules.
    • If needed, create a new "Ticket Creation" automation rule to auto-assign tickets.
  2. Modify Automation Rules

    • Verify if the automation conditions require an assignee before triggering.
    • Adjust the conditions to allow execution even if the ticket is unassigned.
  3. Test with a Sample Ticket

    • Manually create a ticket and assign it to a group.
    • Check if automations are triggered correctly.

Possible Fix: No Feedback from Orchestration Server

Issue: The orchestration server received the command, increased resource usage, but timed out with no response.

Solution:

  1. Check Server Specs & Logs

    • Confirm that the server meets Freshservice requirements.
    • Look at Orchestration Server logs for timeout errors.
  2. Test Network & Firewall Rules

    • Ensure the server can communicate with Freshservice.
    • Whitelist Freshservice IPs in firewall settings.

Reply