PowerShell Newb Question

Apr 21, 2011 at 4:12 PM

Oh mighty PS gurus.  I am trying to apply a template to an incident from the console.  My customer is going to have over 500 templates and does not want analysts to search through a long group of templates when entering the incident.  My idea is to have the analyst fill out a few fields including classification and then click a task called "Apply Custom Template".  This action then runs a PowerShell command to apply a template to the incident based on the classification.  I haven't seen anything in any of the forums that identifies this scenario but I see this being used by several of the larger organizations because of the convenience and reduction in template error selection.  After running the command, the analyst will return to the ticket and complete it.  We can't use a workflow because the workflow does not fire while the incident screen is still open.  Many thanks in advance for anyone that can get me started.

Thanks

 

Apr 24, 2011 at 2:47 PM

I guess I need a rephrase of this question.  How do I apply a template if I do not yet have an ID for the incident?  This is easy enough to do once the ID is created, but before then, how do I take action against an open form?

Developer
Apr 29, 2011 at 8:45 AM
Edited Apr 29, 2011 at 8:50 AM

i'm not sure that this is possible. I don't believe that it's possible to combine the UI and PowerShell actions this way. The only thing that I can think of is via a console task, but you can't control the UI in this way, so while you might be able to apply the template to a blank incident, but you can't then open the form which has the template applied.

Also, I don't believe that you can apply the results of the template to the open form via powershell (I'm pretty sure if you need to do this, you're going to need code behind.

May 10, 2011 at 10:17 PM

We wound up creating our own assembly to add a custom task to the task pane.  Had to be written in C#.