Notification template

I need create template for Review Activity class, in body of notification I need paste field from parent Service request example Title, ID, Description and my custom field.

This strings are not work:

$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemHasParentWorkItem' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$

$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemHasParentWorkItem' TypeConstraint='CustomInfopulse_Sd_BusinessTripServiceRequestClass!Infopulse.Sd.BusinessTripServiceRequest']/Property[Type='CustomInfopulse_Sd_BusinessTripServiceRequestClass!Infopulse.Sd.BusinessTripServiceRequest']/new_Allowance$


Who can help me How write Parent SR Property for Review Activity?

Best Answer

Answers

  • Jamie_JordanJamie_Jordan Customer IT Monkey ✭

    I had to do a similar thing recently and found this worked.

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

    The key to making it work was adding "SeedRole='Target'" into the substitution string after it was generated.

    If you're using a review activity that is nested inside another type of activity and need to get the SR information you'll need to go up one more level to get it. This is what worked for me to get the SR Id into the notification

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

  • Roman_NepomniashchiiRoman_Nepomniashchii Customer IT Monkey ✭
  • Roman_NepomniashchiiRoman_Nepomniashchii Customer IT Monkey ✭

    How I can get affected user from parent SR for RA notification

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAboutConfigItem' TypeConstraint='CustomSystem_Library!System.ConfigItem']$?$DisplayName$?

    it is not work

  • Jamie_JordanJamie_Jordan Customer IT Monkey ✭

    @Roman_Nepomniashchii, I use this to get the first name of the affected user from the SR:

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAffectedUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.User']/FirstName$

    And this to get the last name:

    $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAffectedUser' TypeConstraint='CustomSystem_Library!System.User']/Property[Type='CustomSystem_Library!System.User']/LastName$

    Replacing with display name might work, but in our environment the display name is backwards, so I had to get them separately.

  • Roman_NepomniashchiiRoman_Nepomniashchii Customer IT Monkey ✭

    maybe you know how I can get assigned user? affected I get successful thank you!

Sign In or Register to comment.