Social

onsdag den 21. januar 2015

Submitting a SCSM Request Offering Programmatically

As part of the employee onboarding process there is a request offering on the portal that HR fills out and submits. But recent automation has made a file available with the same information as was entered into the portal. Next step is reading the file and submitting the same request offering programatically (and 100% autonomous).

Using the script I just wrote one can do:

Import-Csv -Path \newemployees.txt -Delimiter ';' | 
    % {\Submit-SCSMRequestOffering.ps1  -RequestOffering $RequestOffering `
                                        -MyInput @($_.firstname, $_.surname, $_.salary)}

Imports a csv-file and submits as many request offerings as there are lines (excluding headers) in the file. One could also just submit a single request offering:


\Submit-SCSMRequestOffering.ps1  -RequestOffering $RequestOffering -MyInput @(1,2,3)

The input corresponds to the questions given in the request offering, and the answer mapping is retained. This is especially useful in flows with many activities where the input to the request offering must be available. Coupled with another script i wrote (Including extension properties in the description field) the activities become a breeze to complete, everything you need right there in the description in a nice prose.

Download the script from Technet Gallery. Remember to rate!

Ingen kommentarer:

Send en kommentar

Bemærk! Kun medlemmer af denne blog kan sende kommentarer.

Søg i denne blog