Run Activity PowerShell == Cannot force run powershell. Status should not be pending or null
Task > Run Activity PowerShell == Cannot force run powershell. Status should not be pending or null.
Best Answer
-
Conner_Wood Customer Ninja IT Monkey ✭✭✭✭So it appears making a new Service Request with no activities and adding a PowerShell Activity then saving the new SR causes the workflow instance to lock up the Activity. By ignoring the workflow instance it is then able to proceed successfully.
While this had nothing to do with the PowerShell script I mine as well post the correct way of taking the parent description and putting it onto the PS Activity itself.
Edit: I'm not sure why the workflow instance would fail under these circumstances, perhaps the workflow starts before the ticket is created so the activity errors out... after looking at the Cireson.Powershell.Activity.Workflow.Library.xml I know the criteria for the Run Activity Powershell Inprogress is UpdateInstance with:Pre = Not Equal In Progress Or IS NULL Post = Equal In Progress
Maybe there needs to be a check within the code to confirm it can grab the ticket, maybe a loop with a delay to try 5 times.... that'd explain the "System.NullReferenceException: Object reference not set to an instance of an object."
0
Answers
While this had nothing to do with the PowerShell script I mine as well post the correct way of taking the parent description and putting it onto the PS Activity itself.
Edit: I'm not sure why the workflow instance would fail under these circumstances, perhaps the workflow starts before the ticket is created so the activity errors out... after looking at the Cireson.Powershell.Activity.Workflow.Library.xml I know the criteria for the Run Activity Powershell Inprogress is UpdateInstance with:
Maybe there needs to be a check within the code to confirm it can grab the ticket, maybe a loop with a delay to try 5 times.... that'd explain the "System.NullReferenceException: Object reference not set to an instance of an object."