locked
How to Include Service Offering in Notification RRS feed

  • Question

  • I'm trying to figure out how to include the selected Service Offering title or category in an email notification template in SCSM 2012 R2.  I've tried a few options with no success, although I have gotten the Request Offering to display properly.  What do I need to do to get the Service Offering (title or category) to display as well?
    Thursday, January 9, 2014 9:45 PM

Answers

  • Ok I managed to get it to work now inside an email template. Notice that the Alias might need to be changed for you:

    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']$?$DisplayName$?

    I needed to do a SeedRole='Target' for the ServiceOfferingRelatesToRequestOffering to switch source and target

    Edit: a good way to test properties is to install Anton's email tester: http://blog.scsmsolutions.com/2013/07/new-tool-scsm-email-template-tester/

    And for Category and Title:

    SR-RO-SO- Category: 
    
    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Category$
    
    SR-RO-SO- Title: 
    
    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Title$

    Monday, January 13, 2014 3:58 PM

All replies

  • Yes you are only able to select Service Request -> Related Request offering from the menu.

    However, the relationship System.ServiceOfferingRelatesToRequestOffering exists, which mean you should be able to construct the property yourself that contains all three classes: SR -> RO -> SO. Is it for Incident or Service Request you want to be able to show it from? Then I can take a look at it later.




    Monday, January 13, 2014 9:05 AM
  • Thanks Morten.  I've got the code below, but SCSM tells me it can't find that item when I try to import the MP.  Do you know the full path for System.ServiceOfferingRelatesToRequestOffering, or better yet, how I can find out what the path is?

    <TypeProjection ID="ServiceOfferingRelatesToRequestOfferingProjection" Accessibility="Public" Type="System!System.Service">

    <Component Path="$Context/Path[Relationship='System!System.ServiceOfferingRelatesToRequestOffering']$" Alias="Service Offering Relates to Request Offering" />

    </TypeProjection>

    Monday, January 13, 2014 2:31 PM
  • Ok I managed to get it to work now inside an email template. Notice that the Alias might need to be changed for you:

    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']$?$DisplayName$?

    I needed to do a SeedRole='Target' for the ServiceOfferingRelatesToRequestOffering to switch source and target

    Edit: a good way to test properties is to install Anton's email tester: http://blog.scsmsolutions.com/2013/07/new-tool-scsm-email-template-tester/

    And for Category and Title:

    SR-RO-SO- Category: 
    
    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Category$
    
    SR-RO-SO- Title: 
    
    $Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Title$

    Monday, January 13, 2014 3:58 PM
  • Thanks for the tip on the email tester.  I have imported that into my environment.  Here's what I did, step by step, which still isn't working:

    1.  Created a new MP in the authoring tool and made a small form customization
    2.  Edited the MP XML to add the type projection in your first box above, using Type="System!System.Service" in the TypeProjection opening statement.  The component path is what you entered in the top box above, with Alias="Test_ServiceOffering" at the end.
    3.  I imported the MP, which failed with error message "Failed to verify component path <path above> for component with alias Test_ServiceOffering : Cannot resolve identifier CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering in the context of management pack <my test MP>.  Unknown alias: CustomSystem_ServiceCatalog_Library".

    What do I need to do?

    Tuesday, January 14, 2014 4:18 PM
  • Allright. As far as I understand your request, there should not be any reason to make a type projection or any other kind of xml edit. You simply just make the email template you want with Service Request as the base class, and then insert the property above in the Body.
    Tuesday, January 14, 2014 6:22 PM
  • I tried that and all I end up with is the property path as it's listed above.  Here's the HTML from my test template:

    <html>
    
    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    
    </head>
    
    <body lang=EN-US link=blue vlink=purple>
    Category
    <br>$Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Category$
    <br>&nbsp;
    <br>Title
    <br>$Context/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.WorkItemRelatesToRequestOffering' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.RequestOffering']/Path[Relationship='CustomSystem_ServiceCatalog_Library!System.ServiceOfferingRelatesToRequestOffering' SeedRole='Target' TypeConstraint='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Property[Type='CustomSystem_ServiceCatalog_Library!System.ServiceOffering']/Title$
    </body>
    
    </html>
    Is CustomSystem_ServiceCatalog_Library a custom MP of yours?  I don't see it in the default list of MPs and it seems like that's where the hang-up is.


    Tuesday, January 14, 2014 6:34 PM
  • Hi Brian,

    These are all standard management packs, but if you copy-paste the property in the body, then it can't figure out to create the reference. So start by selecting a property from the menu of Relates to Request Offering and click OK and reopen the template. Then it should get the right MP reference to CustomSystem_ServiceCatalog_Library. You can of course also verify and edit the aliases in the XML file.

    My template test was based on the Service Request class.

    Wednesday, January 15, 2014 11:40 AM
  • That did it.  Thanks Morten, you've been a HUGE help!
    Thursday, January 16, 2014 1:32 PM