Execute Task A from another Task
I have created a Task in PowerShell to Set the Actual End date on an Incident in SCSM. Once this is done, I want to trigger the "Assign Analyst by Group" Task by Cireson, such that the pop up for it opens and lets the user to assign the analyst by group.
I can easily find the task using: Get-SCSMConsoleTask -Name "Cireson.AssignAnalystByGroup.Task"
But cant figure out a command to run this task.
Can anyone suggest if they know how can I achieve this?
Any help will be appreciated!
Best Answer
-
Brett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭Looks like it is not possible.
You could achieve the same thing within the portal as I described in a previous post.
Sorry that I could not give you a more in-depth answer.5
Answers
I don't think it's possible to be able to run 2 tasks from one action. It likely would be a limitation with SCSM.
Is the Set Actual End Date task automatically run, presumably from resolving an Incident? If so, how would the script know which user to be prompted to Assign Analyst By Group?
Thanks for the response. The Set Actual End Date task is not running automatically. I have written a Code and created a task on the incident form. So what I am looking at achieving is:
When a user click on this custom task, it sets the actual end date of the task (which works as it should). And after this I want the "Assign Analyst by Group" task gets triggered (pop up window appears). If I knew the code behind "Assign Analyst by Group", I would be able to script it along with the code I wrote for Set actual end date.
So am trying to find out a way this can be achieved or anything similar.
@Tony_Collett is right in as much as the SCSM Console is not designed to call tasks from code.
However, if you were trying to achieve the same thing via the Cireson portal then this would be a case of adding in the On.Click command for the task you want to run and it should then execute also.
We will ask internally if anyone has found a way to call a task from PowerShell, or if there is a way to call our code direct from PowerShell to see if this can work int he console also.
Stay tuned.....
As far as I can tell, there is no supported method to call a Console Task. Even the SCSM C# SDK DLLs don't have it, they can execute tasks, but not console tasks. If you are looking to experiment with unsupported C# DLLs ( AND require the next console task executing automatically as it would as if it was clicked in the SCSM Console ), I have recently researched into that messy undocumented area and may have a solution:
Executing tasks on Incident
You could achieve the same thing within the portal as I described in a previous post.
Sorry that I could not give you a more in-depth answer.