Home Service Manager

Request Offering to create a new Request Offering via automation

Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
Has anybody ever done this?

This solution would require:
  • A new MP
  • A new template (based on an existing template?)
  • A new RO with associated prompts
  • Addition of the new RO to Catalog Groups
  • Addition of the new RO to a SO (alternatively a new SO)

Best Answer

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓
    Hi Leigh,

    Never done it but all of the above are possible via SMLets so it should be very doable via some PowerShell.
    Building a Cireson ARO might be slightly trickier as not natively supported by SMlets but if you reverse engineer the XML format for the advanced configuration it might work.

    Geoff

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓
    Hi Leigh,

    Never done it but all of the above are possible via SMLets so it should be very doable via some PowerShell.
    Building a Cireson ARO might be slightly trickier as not natively supported by SMlets but if you reverse engineer the XML format for the advanced configuration it might work.

    Geoff
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    Thanks Geoff. It's good to know this is possible before I embark on this journey.
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    edited December 2016

    @Geoff_Ross, have you had specific experience with creating an RO?

    I've been using the following and cannot get more than one prompt to pass through the New-SCSMRequestOfferingQuestion ForEach loop:
    http://systemcenterme.com/create-request-offering-with-powershell-in-service-manager-2012/

    The error is:

    Method invocation failed because [SMLets.ROMapElement] does not contain a method named 'op_Addition'.


    Edit: Nevermind. I transcribed a $ where it should have been @.

  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    Hi @Leigh_Kilday
    I'd love to see what your solution end sup to be here.
    I'm sure there are plenty of people in our community that would love to see the solution you came up with and to share the PS Code if you can.
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭

    No problem @Brett_Moffett. The bulk of the code is coming from Jonathan Andersson's blog so most of the kudos goes to him.

    So far I have a script that:

    1. Uses Read-Host to set the variables. This will be converted for Orchestrator later on so that the initiating RO user input can be mapped to them. I've allowed for 5x short string, 5x long string and one Simple List at this stage (more on that in #4).
    2. Creates a MP.
    3. Creates a template. At this stage it is a blank template. I can't find any doco on how to give it activities yet.
    4. Creates a RO and uses the prompts to create questions. I'm trying to figure out how to add multiple values to a Simple List prompt - the usual delimiters, arrays and simply repeating the prompt with new values haven't worked.
    5. Produces an error when the RO has been created, but it isn't clear what the issue is. This does not affect the outcome, however. The RO works as expected.

    Still to do:

    1. Setting the RO image. I'm not too concerned with this one.
    2. We already have scripts to add ROs to a SO. I just have to add it to this script. For our own purposes we don't need to create a new SO, but if I get some time to build it I will.
    3. Enabling the new template in User Roles.
    4. Converting the script to a runbook.
    5. Creating the initial RO to kick all of this off in the first place.
    Even as it is right now, it's so much faster to create a new RO. I wish we had this when we were building them for launch!
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭

    It looks like those scripts are fleshed out a bit more here:
    https://blogs.technet.microsoft.com/wincat/2013/03/04/automating-service-manager-service-request-catalog-deployment-through-powershell-and-csv-files/

    I looked at this once before when I was new to SCSM and didn't think it was worth the effort for bulk-RO insertion.

    Reviewing the above code, I still don't know how to create more than one entry in the Simple List answers, but it does have solutions for setting the RO image, creating the SO, and linking the RO and SO.

    The error I mentioned before was because I had the native cmdlets loaded, but they were not necessary for the script.

  • fe_fefe_fe Customer IT Monkey ✭
    edited February 2017
    @Leigh_Kilday actually tried that solution. Didn't really work too well, even did a few modifications. It still doesn't support mapping RO answers to Child activity fields/properties.
    Creating RO's and mapping fields is a massive pain in the ass in SCSM, because I'm not using Advanced Request Offering, I think ARO would save me some time.
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    It's not ideal, but it's a start. What we're looking for is to reduce the time it takes for an RO to make it to production, as one of our pain points is people using a generic SR without any reportable metadata. If we can make it easier for people to get their request on the portal, we can block people from accessing the generic SR.

    Further development on the RO can occur later when the admin team has time.

    I haven't had time to work on this further, but I believe it would pass testing based on our requirements.
Sign In or Register to comment.