Using a related object from the deleted relationship to notify ex-assigned analysts (C# version)

Engaging data from deleted relationships can be very useful in some cases. For instance, to be aware if someone deletes affected users in the closed cases or replaces attachments etc.

In one of my first post I described how to send notification to an ex-AssignedTo analyst about a withdrawal. Actually, instead of using the data from the deleted relationship, I created an instance of the new custom relationship using a PowerShell script and used it to send a notification.

Working with a custom relationship can give some advantages but in many cases it would be better just to use related item from the deleted relationship. For instance, if we want to send a message to the ex-assigned analyst in SCSM 2012.

In Microsoft System Center 2012 Service Manager a work item can have the one and only currently assigned analyst and many ex-assigned analysts. And the only way to get the required ex-assigned analyst is to identify the analyst in the moment of the withdrawal.

We can do it using a $Data/RelatedBaseManagedEntityId$ as a workflow parameter.

Screenshot1

But if we try to pass this parameter to the default SCSM notification workflow, nothing happens. So we need a custom workflow to send a notification. For this purpose, we can reuse a code presented in my previous posts.

Read the rest here.

Leave a Reply