How NOT to email end users about converted work items or how to email in SCSM 2012 using C#

I spent most of my last weekend to help our customer to solve the situation with notifications for affected users. Originally, the customer had set up following the notification workflows:

  1. If a new incident is created, send an email to an affected user with details;
  2. If a new service request is created, send an email to an affected user with details;

That was simple and clear. After deploying SCUtils ConvertTask that could convert incidents to service requests and vice-versa, the customer created additional notification workflows (here the video) to inform the affected users that previous incident/service request was converted to service request /incident.

Everything worked like a charm. But the customer wasn’t happy because the affected users received the first notification like ‘Your incident IR4555 has been converted to SR4556…’ and the second one like ‘The service request SR4556 has been created by your request…’. So the end user got two notifications where the latter one was obviously needless. However, if the work item was created by a regular way, that second notification was quite appropriate.

For the very beginning, the task seemed to be very easy but the customer could not use Orchestrator and I didn’t find any simple way to create a PowerShell script or workflow without extending incident and service request’s classes to send emails with the beautiful HTML templates that the customer had designed.

After several useless attempts to build a simple and use-to-use solution, I gave up and opened Visual studio. Then I closed Visual Studio and opened Bing and Google to find out the information how to send a notification programmatically in Microsoft Service Manager. Finally, I came to this blog post of Oren Beeri to whom I really appreciate. It was a first point to start and I want to share the result with the community including our beloved customers.

The rest of the article and the source files are available here.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.