locked
Email notification template for review activity does not include comments RRS feed

  • Question

  • Dear All,

    i have created a review activity, and when ever the reviewer approves or rejects he/she inputs comments.

    I have created a notification template for this activity and inserted substituted string "comments" in the template.

    But when the notification is sent, the comments feild is blank even though the reviewers have comented

    Please help how do i properly insert comments in notification template

    Thanks,

    chlava

    Monday, July 24, 2017 4:54 AM

Answers

  • Hi

    The comments you have on the template are probably for the Review Activity itself and they will be blank.

    The comments you are after are on the related Reviewers - Insert on the RA template and then expand Review Activity to find Reviewers and then choose comments:

    This should insert something like this:

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Property[Type='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Comments$

    Regards

    Glen


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

    • Marked as answer by chlava Monday, July 24, 2017 7:17 AM
    Monday, July 24, 2017 6:04 AM
  • Hi

    I got it working in my lab, I had typo issues editing the properties. Antoni H's blog post above is the best and most complete guide out there for doing this.

    Step 1: Create all templates in one management pack. There are stored references that are needed between the templates. Consider a separate Management Pack for these Review templates, but this is a personal choice.

    Note: this will only work if the RA is at the top level of the activity workflow ie not in a Parallel or Sequential Activity. See Antoni's blog for details on how to deal with this.

    Step 2: Create a Change Request based template in the management pack. Add the Implementation, risk, test and back out plans.

    It should give you something like this:

    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/ImplementationPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/RiskAssessmentPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/BackoutPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/TestPlan$

    Step 3: Confirm that you can get data from the change using SeedRole. For this step we are following the instructions in Travis Wright's blog or the top part of Antoni's blog. 

    Create a Review Activity template in the management pack. Use the contains activity (there maybe two, either is ok) to add in the Work Item ID.

    Then edit this to add the SeedRole = 'Target' in the correct place. The result should look like this:

    Change ID - $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$

    Confirm this is working before moving to the next step.

    Step 4: Take the information from Step 2 and combine it with the Change ID example from Step 3. Copy the Change ID inserted lines 4 times, so there is one for each plan. Now edit each of them to put in the correct references, alias and properties.

    If your lines are looking exactly the same as mine you can try copying and pasting mine into your template.

    I highlighted in bold the parts I needed to change\add (from the copied ChangeID) and the SeedRole on the Implementation plan. I also had issues with long underscores __ rather then _.  

    End result that is working in my lab

    Implementation Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/ImplementationPlan$

    Back out Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/BackoutPlan$

    Risk Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/RiskAssessmentPlan$

    TestPlan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/TestPlan$

    I hope this gets it working for you.

    Regards

    Glen

     


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


    • Edited by Glen.Xapity Monday, July 24, 2017 9:05 PM spelling
    • Marked as answer by chlava Tuesday, July 25, 2017 2:41 AM
    Monday, July 24, 2017 9:04 PM

All replies

  • Hi

    The comments you have on the template are probably for the Review Activity itself and they will be blank.

    The comments you are after are on the related Reviewers - Insert on the RA template and then expand Review Activity to find Reviewers and then choose comments:

    This should insert something like this:

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.ReviewActivityHasReviewer' TypeConstraint='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Property[Type='CustomSystem_WorkItem_Activity_Library!System.Reviewer']/Comments$

    Regards

    Glen


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

    • Marked as answer by chlava Monday, July 24, 2017 7:17 AM
    Monday, July 24, 2017 6:04 AM
  • Hi Glen,

    thanks a lot for your help

    thanks

    Monday, July 24, 2017 7:18 AM
  • Hi,

    May i also check how can i insert implementation plan, test pan, risk plan and back out plan in the notification sent to reviewers? i have tried to insert them but i see blank data

    Also help me on how to insert reviewers name in the notification

    My template looks as below, i have inserted them from class "Depends on work items"

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

    The following review activity has been assigned to you for review. Please click the link below to approve or reject the review activity.



    Title: $Context/Property[Type='WorkItem!System.WorkItem']/Title$
    Description: $Context/Property[Type='WorkItem!System.WorkItem']/Description$
    CreatedDate: $Context/Property[Type='WorkItem!System.WorkItem']/CreatedDate$
    ApprovalPercentage: $Context/Property[Type='CoreActivity!System.WorkItem.Activity.ReviewActivity']/ApprovalPercentage$
    Implementation Plan: $Context/Path[Relationship='WorkItem!System.WorkItemDependsOnWorkItem' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/ImplementationPlan$

    Test Plan: $Context/Path[Relationship='WorkItem!System.WorkItemDependsOnWorkItem' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/TestPlan$

    Risk: $Context/Path[Relationship='WorkItem!System.WorkItemDependsOnWorkItem' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Risk$

    Backout Plan: $Context/Path[Relationship='WorkItem!System.WorkItemDependsOnWorkItem' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/BackoutPlan$

    http://xxxxxxxx/MyActivities

    This Email is auto generated from Service Manager

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

    Thanks,

    chlava





    • Edited by chlava Monday, July 24, 2017 7:39 AM
    Monday, July 24, 2017 7:33 AM
  • Hi

    To get the "Plans" into the notification you need to use the Seed Role syntax. 

    Have a look at this post: https://blogs.technet.microsoft.com/servicemanager/2012/04/03/using-data-properties-from-the-parent-work-items-in-activity-email-templates/

    Be careful if you copy and paste. The quotes and spaces are sensitive.

    Getting the Reviewers display name is a problem. This is stored as a relationship and would take a Powershell activity or Orchestrator Runbook to get the display names and then store them somewhere for you to use in a template eg they get added to the description field of the RA.

    Regards

    Glen


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

    Monday, July 24, 2017 8:02 AM
  • Hi Glen,

    Thanks for your valuable answer. i went trough the sysntax but its ver confusing. And i was not able to find the plans in "contains activity"

    Can you help me with seed role syntax for implementation plan, test pan, risk plan and back out plan

    I am very poor in developing

    thanks,

    chlava

    Monday, July 24, 2017 8:28 AM
  • Hi

    Sorry, as you want Implementation Plan, Test plan, Risk Plan, Back Out plan the link before is not going to work. It only does the generic Work Item properties eg Description, ID

    This link gives a more in depth example and does step through how to add the "Plans" to the RA template.

    https://blogs.technet.microsoft.com/antoni/2014/05/23/include-details-from-parent-work-items-in-notifications/

    It does take a few more steps. And the highlight colors help explain the 3 bits of information you need: MP Alias, Change Request class internal name and property internal name.

    I am trying to get it to work in a lab, but am also having some issues. I will work on this tomorrow and will hopefully be able to post back a step by step guide. 

    The link in this post is very good and does explain how to get the data you want in the template.

    Regards

    Glen


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

    Monday, July 24, 2017 9:36 AM
  • Hi

    I got it working in my lab, I had typo issues editing the properties. Antoni H's blog post above is the best and most complete guide out there for doing this.

    Step 1: Create all templates in one management pack. There are stored references that are needed between the templates. Consider a separate Management Pack for these Review templates, but this is a personal choice.

    Note: this will only work if the RA is at the top level of the activity workflow ie not in a Parallel or Sequential Activity. See Antoni's blog for details on how to deal with this.

    Step 2: Create a Change Request based template in the management pack. Add the Implementation, risk, test and back out plans.

    It should give you something like this:

    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/ImplementationPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/RiskAssessmentPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/BackoutPlan$
    $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/TestPlan$

    Step 3: Confirm that you can get data from the change using SeedRole. For this step we are following the instructions in Travis Wright's blog or the top part of Antoni's blog. 

    Create a Review Activity template in the management pack. Use the contains activity (there maybe two, either is ok) to add in the Work Item ID.

    Then edit this to add the SeedRole = 'Target' in the correct place. The result should look like this:

    Change ID - $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$

    Confirm this is working before moving to the next step.

    Step 4: Take the information from Step 2 and combine it with the Change ID example from Step 3. Copy the Change ID inserted lines 4 times, so there is one for each plan. Now edit each of them to put in the correct references, alias and properties.

    If your lines are looking exactly the same as mine you can try copying and pasting mine into your template.

    I highlighted in bold the parts I needed to change\add (from the copied ChangeID) and the SeedRole on the Implementation plan. I also had issues with long underscores __ rather then _.  

    End result that is working in my lab

    Implementation Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/ImplementationPlan$

    Back out Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/BackoutPlan$

    Risk Plan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/RiskAssessmentPlan$

    TestPlan:  $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/TestPlan$

    I hope this gets it working for you.

    Regards

    Glen

     


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


    • Edited by Glen.Xapity Monday, July 24, 2017 9:05 PM spelling
    • Marked as answer by chlava Tuesday, July 25, 2017 2:41 AM
    Monday, July 24, 2017 9:04 PM
  • Hi Glen,

    Thanks a lot for your help.

    Thanks,

    chlava

    Tuesday, July 25, 2017 2:41 AM