Setting status of declined Service Requests to Rejected instead of Failed
Introduced in SCSM 2012, Service Request has lacked a Rejected status from the very beginning. If any Review Activity of a Service Request is declined, the Service Request gets a Failed status. It’s a very confusing behavior that also affects the reporting.
One of our customer wants to solve the situation but with a minimum impact on the system's performance. That means a Visual Studio project. And here I’m presenting the result.
The Rejected status has to be safe and I put it in the sealed management pack to avoid an accidental erase. A workflow setting a Service Request in the Rejected status is triggered when the Service Request gets the Failed status. It examines all Review Activities inside the Service Request and sets the Service Request’s status to Rejected if any internal Review Activity has been rejected.
My first intension was to run the workflow when a Review Activity is set to the Rejected status but the default Service Manager workflow also uses this condition to set the Service Request’s status to Failed. So it was unpredictable which one would start the last and make the last change of the status.
In the attached archive, you can find a source code of the solution that could be used to add additional features like an action log's record for the status change, a support for Change Requests, etc.
To deploy the solution, copy SCUtils.SetServiceRequestToRejected.dll to the Service Manager installation folder (the default path is C:\Program Files\Microsoft System Center 2012\Service Manager or for SCSM R2 C:\Program Files\Microsoft System Center 2012 R2\Service Manager). Then import SCUtils.Rejected.ServiceRequest.mpb.
I also added in the solution a custom view, SCUtils.ServiceRequestView.Rejected.MP.xml, for Rejected Service Requests for those who are lazy enough but you can easily create your own view. Please excuse me, if you found that a name of the view has a wrong translation to your own language. Please advise me with the proper translation and we will make the world (the management pack actually) a bit better.
I hope that this small improvement will make your system based on Microsoft System Center 2012 Service Manager a bit more intuitive.