locked
Form fields that are people pickers do not show properties when viewing the object in powershell RRS feed

  • Question

  • I am working with a custom Change Request form, that has a number of fields that are "people pickers"

    When I access the object in Powershell, I am not able to see these fields, or thier values.

    What I am wanting to do is, to send an email to the person in the "CR requestor" field, when a seperate field (start date) is filled in for the "CR manual activity".

    I have not been able to accomplish this using the notification/subscription features.

    My thought was to create a PS workflow, that is triggered when a MAObject is changed, the script will check the MAObject for the StartDate, and status.

    If in the proper status, and the start date on the MAobject is filled, I want to send an email to the person listed as on the requestor on the CR Form.

    Any Ideas?


    Joshua Fuente


    • Edited by NachoScript Wednesday, January 9, 2013 12:32 AM typo
    Wednesday, January 9, 2013 12:31 AM

Answers

  • Hi there,

    People picker are controls to display relationships between two classes. So your picker binds to a particular Relationship Class within SCSM.

    With this code sample you can get the related object. For this you need to know the relationship class name you're actually interested in.

    $RelClass = Get-SCSMRelationshipClass MyCRRelationshipClass
    Get-SCSMRelatedObject -SMObject $CRObject -Relationship $RelClass

    Based on this approach you can get your way to the SMTP address of a particular user. Please note the SMTP address is not a direct property of the user class, it's stored in an own class called Preference. You have to use the 'System.UserHasPreference' relationship to get from the user class to the preference class, where the SMTP address is stored as a property.

    Regards

    Alex

    • Marked as answer by NachoScript Wednesday, January 9, 2013 9:31 PM
    Wednesday, January 9, 2013 8:28 AM

All replies

  • Hi there,

    People picker are controls to display relationships between two classes. So your picker binds to a particular Relationship Class within SCSM.

    With this code sample you can get the related object. For this you need to know the relationship class name you're actually interested in.

    $RelClass = Get-SCSMRelationshipClass MyCRRelationshipClass
    Get-SCSMRelatedObject -SMObject $CRObject -Relationship $RelClass

    Based on this approach you can get your way to the SMTP address of a particular user. Please note the SMTP address is not a direct property of the user class, it's stored in an own class called Preference. You have to use the 'System.UserHasPreference' relationship to get from the user class to the preference class, where the SMTP address is stored as a property.

    Regards

    Alex

    • Marked as answer by NachoScript Wednesday, January 9, 2013 9:31 PM
    Wednesday, January 9, 2013 8:28 AM
  • Thanks!


    Joshua Fuente

    Wednesday, January 9, 2013 9:31 PM