[SM] Submitted service requests and incidents in the Portal enter a closed state
I wanted to write an article on the new SM HTML5 portal, because one of the issues it has is that submitted service requests and incidents in the Portal enter a closed state.
This was fixed with UR2, however even after installing this fix custom states also are displayed with the closed states. So the portal does not know about the custom state and will set as a default state all SR or incidents like this.
I made also a repro for this, so I will also post the steps on how I got to it, as a quick version:
1.create a custom SR status, save it into an MP, in this case CustomMPSts
2. use PS to update an SR status to a custom state (previously created)
# Get a specific Service Request
$ServiceRequest = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest) -filter "ID -eq SR81"
# Change the status of the Service Request to Completed
Set-SCSMObject -SMObject $ServiceRequest -Property Status -Value "CustomMPSts"
3. See in the SM portal (with UR2) status is set to close:
Service Request type requests: https://localhost:444/MyRequests/RequestDetails?type=ServiceRequest&id=SR81
The closed status is set also for states like: completed, failed, on hold, cancelled. This is by design, but you can edit this in the portal.
In order to change the way states are displayed, you will have to edit the web.config of the SM Self Service Portal
Here is the official documentation for on how to achieve this:
By default, the portal puts custom enumerations for My Request (incident & Service Requests) states in the Closed filter category. Now the portal allows for customization to map required custom states to the Active filter category also. For more details check for “CustomActiveRequestStatusEnumList” under “Basic Customization” section on this link.
The <appSettings> tab in the Web.config file offers some standard settings to easily customize and personalize the areas which are most often modified. Here’s a list of them
CustomActiveRequestStatusEnumList By default, the Self Service portal puts custom enumerations for My Request (incident and service requests) states in the Closed filter category. This key allows customization to map required custom states to the Active filter category. The value of this key should be a comma separated list containing EnumTypeName values of enumerations which are required to be mapped with the Active category in the Self Service Portal. You can look for desired custom states labeled EnumTypeName in the EnumType table, using the following example.
FROM [<Service Manager DB name, which by default is “ServiceManager”>].[dbo].[EnumType]
So for the custom states to be displayed correctly, we have to get the corresponding EnumTypeName from the DB (or MP) and edit it in the web.config under the AppSetting, attribute: CustomActiveRequestStatusEnumList
The EnumType has a form like Enum.e6afdb9a20aa4cdbabcd5ef24369f900[GUID], so you can search in the MP after this.