locked
Reviewer Name in Notification RRS feed

  • Question

  • Dear All,

    Can someone help me how to include the reviewer name in the review activity completed/failed notification.

    I have inserted "display name" from class "reviewers", but the display name is being shown as below (832)

    My notification is as below

    ------------------------------------------------

    The Change Request is Approved

    Review Id: RA18648
    Title: Dummy- Patching
    Status: Completed
    ApprovalCondition: Percentage
    Decision: Approved
    DecisionDate: 2/8/2017 2:32:10 PM
    Comments: approved
    DisplayName: 832

    ---------------------------------------

    thanks,

    chlava

    Wednesday, August 2, 2017 6:56 AM

Answers

  • Hi

    Have a look at this post from Morton Meisler: https://social.technet.microsoft.com/Forums/Lync/en-US/aa4a4dae-e02c-48f9-b5f6-e9c545bb2545/email-notification-to-reviewer-for-review-activity-getting-display-name-of-user?forum=administration

    He suggests the following, but this did not work in my lab due to the references being different (as Morton points out in his post - they have to match your instance).

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewerIsUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.User']/DisplayName$

    The reference to the System.User (in bold) was incorrect for my environment.

    One way to check and correct this is to:

    1. Create a new notification template in the same management pack as the RA template.

    2. Use the User Class - change to All basic classes and choose User.

    3. Create a title and then insert the User displayname. I got the following in my lab:

     $Context/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$

    4. Save the template. I also got an error, but ignored it. The purpose of the template is to put the references into the Management Pack and to confirm the display name reference. After saving the template, we could delete the template and it would leave the references behind.

    You could also do this by hand if you are comfortable editing the Management Packs. Just export the management pack, add the references and re-import.

    5. Edit the RA template and paste in the display name example. All I had to change from Morton's example was User to Entity:
    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewerIsUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$

    Regards

    Glen


    Web: www.xapity.com  |   Twitter: @xapityapps  |   Facebook: xapityapps



    Wednesday, August 2, 2017 10:02 AM
  • Hi

    Yes that is correct. In the existing template it will not be there.

    Create a completely new notification template in the same management pack as the RA template and then choose the User class, following the steps from above. 

    You could just try pasting on Morton's example and then try my example. They may just work if all the references are the same. The purpose of creating the new template is to check what the references are.

    As a side note I would recommend creating your notification templates in a separate Management Pack. It generally makes it easier to edit if required and easier to move the MP between environments. But it will work in the system one that you have used.

    And just to clarify a bit more on management packs.

    Management packs come in two types:

    • Sealed 
    • Unsealed 

    When you create new templates, new views, new lists etc in Service Manager, they will be stored in an unsealed management pack. It is generally a good idea to organize the data stored in unsealed management packs eg one for Views,  one for templates, one for lists. There are a number of ways of doing this and it really is up to you how you want to organize things in Service Manager.

    Creating a new Management Pack in the Service Manager wizards will give it a friendly Display Name, but when exported it will have a Guid like name. Create them in the Service Manager Authoring tool first as blank MPs and import them into Service Manager to get around this.

    Unsealed Management Packs should be backed up regularly because this holds the structure you have developed in Service Manager.

    When you export a Management Pack, you can see the XML. The top section is a references section. This is where you reference other sealed management packs as aliases eg CustomSystem_WorkItem_Activity_Library!  If these are not present in the Management Pack when you paste them into a template Service Manager will not know how to translate to data. This is the problem we are trying to solve when we create the new template above, without having to edit the management pack xml directly.

    Regards

    Glen


    Web: www.xapity.com  |   Twitter: @xapityapps  |   Facebook: xapityapps

    Wednesday, August 2, 2017 11:41 AM

All replies

  • Hi

    Have a look at this post from Morton Meisler: https://social.technet.microsoft.com/Forums/Lync/en-US/aa4a4dae-e02c-48f9-b5f6-e9c545bb2545/email-notification-to-reviewer-for-review-activity-getting-display-name-of-user?forum=administration

    He suggests the following, but this did not work in my lab due to the references being different (as Morton points out in his post - they have to match your instance).

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewerIsUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.User']/DisplayName$

    The reference to the System.User (in bold) was incorrect for my environment.

    One way to check and correct this is to:

    1. Create a new notification template in the same management pack as the RA template.

    2. Use the User Class - change to All basic classes and choose User.

    3. Create a title and then insert the User displayname. I got the following in my lab:

     $Context/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$

    4. Save the template. I also got an error, but ignored it. The purpose of the template is to put the references into the Management Pack and to confirm the display name reference. After saving the template, we could delete the template and it would leave the references behind.

    You could also do this by hand if you are comfortable editing the Management Packs. Just export the management pack, add the references and re-import.

    5. Edit the RA template and paste in the display name example. All I had to change from Morton's example was User to Entity:
    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewerIsUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.Entity']/DisplayName$

    Regards

    Glen


    Web: www.xapity.com  |   Twitter: @xapityapps  |   Facebook: xapityapps



    Wednesday, August 2, 2017 10:02 AM
  • Hi Glen,

    I am not able find the user class in my related classes

    I am using "Service Manager Activity Management Configuration Library" management pack

    Thanks,

    chlava

    Wednesday, August 2, 2017 10:51 AM
  • Hi

    Yes that is correct. In the existing template it will not be there.

    Create a completely new notification template in the same management pack as the RA template and then choose the User class, following the steps from above. 

    You could just try pasting on Morton's example and then try my example. They may just work if all the references are the same. The purpose of creating the new template is to check what the references are.

    As a side note I would recommend creating your notification templates in a separate Management Pack. It generally makes it easier to edit if required and easier to move the MP between environments. But it will work in the system one that you have used.

    And just to clarify a bit more on management packs.

    Management packs come in two types:

    • Sealed 
    • Unsealed 

    When you create new templates, new views, new lists etc in Service Manager, they will be stored in an unsealed management pack. It is generally a good idea to organize the data stored in unsealed management packs eg one for Views,  one for templates, one for lists. There are a number of ways of doing this and it really is up to you how you want to organize things in Service Manager.

    Creating a new Management Pack in the Service Manager wizards will give it a friendly Display Name, but when exported it will have a Guid like name. Create them in the Service Manager Authoring tool first as blank MPs and import them into Service Manager to get around this.

    Unsealed Management Packs should be backed up regularly because this holds the structure you have developed in Service Manager.

    When you export a Management Pack, you can see the XML. The top section is a references section. This is where you reference other sealed management packs as aliases eg CustomSystem_WorkItem_Activity_Library!  If these are not present in the Management Pack when you paste them into a template Service Manager will not know how to translate to data. This is the problem we are trying to solve when we create the new template above, without having to edit the management pack xml directly.

    Regards

    Glen


    Web: www.xapity.com  |   Twitter: @xapityapps  |   Facebook: xapityapps

    Wednesday, August 2, 2017 11:41 AM