Display information of parent SR in notification mail of review activity
I try to display several information of a parent SR in our Mail notification but it does not work. Above you can see an example for it. It is also not possible to display the name of the affected user. It worked in previeous versions but I do not know since when it dosn´t work anymore. Could anyone help pleas? Regards, Margret
Best Answer
-
Matt_Overton Customer Adept IT Monkey ✭✭
Also, to display the name of the affected user from the parent SR, this should do it:
$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='System!System.ConfigItem']$?$DisplayName$?
Hope this is helpful!
5
Answers
I think I had a very similar issue. I have a feeling it's something to do with it needing to get information from the parent object instead of a child object. Try this:
In the title instead of:
[$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$]
and...
[$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Title$]
Try:
[$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$]
and...
[$Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Title$]
I'm not going to say I fully 100% understand this myself, but I think by including that relationship beforehand and using "SeedRole='Target'", it's telling it to fetch the values from the parent item.
Also, to display the name of the affected user from the parent SR, this should do it:
$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='System!System.ConfigItem']$?$DisplayName$?
Hope this is helpful!
Thank you very much. It works now. What I do not like is that we cannot use the Insert button to choose those informations. Regards, Margret