Home Notify Analyst

How can I add the Request ID in the notification of a MA notification?

Ron_EvansRon_Evans Customer IT Monkey ✭
I am trying to add the Request ID into the notification template for MA notifications. Is this because of related classes in the template?

Best Answer

Answers

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    I ran into the same issue
    https://community.cireson.com/discussion/1802/review-notifications#latest
    Been using the fix for about a year and as long as the run books do not stop it works fine. 
  • john_doylejohn_doyle Cireson Support Ninja IT Monkey ✭✭✭✭
    Hi @Ron_Evans 

    I had this question come up a long time ago relating to Review Activities and Change Requests. This is the process I used to set this up in my lab.

    The problem is that you are trying to reference a reverse association. In this case the Change Request is the source and the activity is the target. I can only tell you how I built it in my lab.
    1.  Create a new notification template for Change Requests. Insert substitution strings for the values you are interested in. You will get something like this: $Context/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Risk$
    2. Open your notification template for the Review Activity class and insert a substitution string for the Contains Activity related class and pick any value. It will look something like this: $Context/Path[Relationship='SWAL!System.WorkItemContainsActivity' TypeConstraint='SWAL!System.WorkItem.Activity']/Property[Type='SWAL!System.WorkItem.Activity']/Area$
    3. Combine the two expressions and add SeedRole='Target'
      In my case it looks like this: $Context/Path[Relationship='SWAL!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Risk$
      The Relationship comes from step 2, then SeedRole='Target'. The TypeConstraint is the taken from step 1. If you copy how I have done it above it should work.  




  • john_doylejohn_doyle Cireson Support Ninja IT Monkey ✭✭✭✭
    Just looking at this again, you should be able to reference the System.WorkItemHasParentWorkItem relationship type, which is a relationship between the activity as the source and the work item as the target.
    $Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemHasParentWorkItem' TypeConstraint='CustomSystem_WorkItem_Library!System.WorkItem']/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$

    Either way will work, unless one of the relationships is not available.
  • Ron_EvansRon_Evans Customer IT Monkey ✭
    Thanks John, appreciate it. I will try this sometime today and let you know.
  • Ron_EvansRon_Evans Customer IT Monkey ✭
    John, your last post works like a charm. Thank you so much for the post and your time. I really appreciate it.
  • john_doylejohn_doyle Cireson Support Ninja IT Monkey ✭✭✭✭
    Hi @Ron_Evans
    I'm glad it worked for you. Can you please flag the post which answered the question with the answer button? Thanks
  • Ron_EvansRon_Evans Customer IT Monkey ✭
    Just answered, many thanks.
Sign In or Register to comment.