The following is how to create the PowerShell Activity Script and template for this example.
Note: This example maps the answer to a Simple List question in an SCSM Request Offering to a Service Request Support Group.
Create the PowerShell Script
Create a new PowerShell Activity Script. Set the Title to match the Request Offering you will use this for & check Published. You will have to use a separate script for each Request Offering.
In the Powershell Script window, add the following:
param([guid]$parentId)
Â
Import-Module smlets
Â
#Enter the question exactly as on the Request Offering
$question = "Select Type of Request"
Â
$parent = Get-SCSMObject -id $parentId
[xml]$UserInput = $parent.UserInput
Â
$answer = ($UserInput.UserInputs.UserInput | ?{$_.question -eq $question}).answer
Â
#Map the Answer to the Support Groups. ex. "Bathroom Request" (answer) is mapped to "Facilities" (Support Group)
switch($answer) {
   "Bathroom Request" { $parent | Set-SCSMObject -Property SupportGroup -Value 'Facilities' }
   "Computer Request" { $parent | Set-SCSMObject -Property SupportGroup -Value 'Desktop Support' }
   "Benefits Request" { $parent | Set-SCSMObject -Property SupportGroup -Value 'HR' }
   default { $parent | Set-SCSMObject -Property SupportGroup -Value 'Service Desk Support' }
   }
Â
Create the Templates
The following are the templates to create for this example.
PowerShell Activity Template
In Templates, create a new PowerShell Activity template. Set the name to match the Request Offering.
Set any of the other fields on the General tab as applicable. On the PowerShell Script tab, click the ellipsis (…) and select the PowerShell Script you created for this RO. Map the parentId parameter to the Parent Base Id property and click OK.
Request Offering Template
In Templates, create a Service Request Template as follows:
Set the Title, Urgency, Priority, etc. on the General tab.
On the Activities tab, add the PSA Template your created. And click OK to save the template.
Â
Advanced Request Offering
The following is how to create the ARO for this example.
Note: If you do not have Cireson Advanced Request Offering installed, you can use the OOB Request Offering builder.
Use the SR Template you created.
Type the question in exactly how you have it in the PS Script. Set it to Simple List.
Configure the answers in the Simple List exactly as you did in the PS Script.
Map the question to the Title of the SR as follows (if you don’t have ARO, pick a text field to map it to).
Publish the ARO to the Portal.