Home Self-Service Portal - Community

Query field for Servcie Request like "Create request on behalf of"

Hi all,

i would like to create a Service Request to rename User in AD. Therefore i had created a query field in SCSM.
Is it possible to change this field in the portal to behafe like "Create request on behalf of".
As there are a lot of users, i don´t want to change the maximum limit for enum field.



Thanks,
Dominik

Answers

  • carrie_medinecarrie_medine Member Advanced IT Monkey ✭✭✭
    Hello,
    This is not currently possibly on the Request Offering Form, however we have had some clients implement an additional text input on the request offering form that can be used as a token to pre-filter the User Query input.
    Let me know if have any questions.
    Thanks,
    Carrie
  • Dominik_WilsbergDominik_Wilsberg Customer IT Monkey ✭
    Great, thank´s again for your quick response. Is it possible to get an example of that filtering?
  • carrie_medinecarrie_medine Member Advanced IT Monkey ✭✭✭
    Sure the RO configuration would look something like this with 1 text input and 1 query input:



    Then within the Criteria Configuration of your Query input use the text input as a filter :



    Once saved and sync'd by the cachebuilder the request offering would load like this - where the query input is not populated until the User enters something into the first text field:



  • Dominik_WilsbergDominik_Wilsberg Customer IT Monkey ✭
    Ah, OK. That´s clear. I´ve already filtered like that.
    I thought it was something specific for the protal!

    Thank´s for your support!
  • Joe_BurrowsJoe_Burrows Cireson Devops Super IT Monkey ✭✭✭✭✭
    Hi Dominik

    This one is also open on the below feature request if you want to give it an upvote:
    https://community.cireson.com/discussion/238/

    Cheers
    Joe
  • Paul_SpechtPaul_Specht Customer IT Monkey ✭
    I have this set up, but when I attempt in my runbook to get the affected user, it is pulling 3 items.  can anyone provide the RB steps to pull the user selected?
  • Paul_SpechtPaul_Specht Customer IT Monkey ✭
    Ok I figured it out.  It returns the data as user input.  
  • Paul_SpechtPaul_Specht Customer IT Monkey ✭
    To assist anyone else who is using this.  To get the user inputs out of the request I needed to add (2) XML Queries.  The first one to get the User input data, the second to pull just the answer I was looking for.
    I only wanted to grab the Display name from the Query results so I could use it to update users pictures in Exchange.

    The user input looks like this when the Get Object activity grabs it from the SR.
    <UserInputs><UserInput Question="Select User - use list below" Answer="&lt;Values Count=&quot;1&quot;&gt;&lt;Value DisplayName=&quot;Last, First&quot; Id=&quot;055826b0-e12f-4cfa-c37f-3f29f862ee4a&quot;/&gt;&lt;/Values&gt;" Type="System.SupportingItem.PortalControl.InstancePicker" /><UserInput Question="Domain" Answer="Domain" Type="string" /><UserInput Question="Picture File" Answer="16084.jpeg" Type="" /></UserInputs>

    1st XML Query:
    XML Text = User input from Get Object activity that gets the Service request
    XPath Query = /UserInputs/UserInput[@Question='Select User - use list below']/@Answer

    2nd XML Query:
    XML Text: Query results from 1st XML Query
    XPath Query: /Values/Value/@DisplayName

    This should give you the users display name as Escaped Query result. 

  • Cary_MyersCary_Myers Customer IT Monkey ✭
    Same process to extract user input and put in readable form. in Powershell.  The example below is using the results of a query.

    $SRID = 'SR####'

    $ServiceRequest = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -filter "ID -eq $SRID"

    [XML]$SRUI = $ServiceRequest.UserInput

    $SRUD = $SRUI | Select-xml -Xpath "/UserInputs/UserInput[@Question= 'Mobile Device you are requesting service for.']/@Answer" | Select-Object -ExpandProperty "node"

    $DN = $SRUD.'#text' | Select-xml -xpath "/Values/Value/@DisplayName" | Select-Object -ExpandProperty "Node"

    $dn.'#text'

    This example is for a value that is manually inputted.

    $SRID = 'SR####'

    $ServiceRequest = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -filter "ID -eq $SRID"

    [XML]$SRUI = $ServiceRequest.UserInput

    $SRUD = $SRUI | Select-xml -xpath "/UserInputs/UserInput[@Question= 'Destnation Country of Travel']/@Answer" | Select-Object -ExpandProperty "node"

    $srud.'#text'
Sign In or Register to comment.