Hiding enumeration values
A customer has a requirement that on some Service Requests (with a specific "Source" or "Area") that some enumeration values, specifically some of the status values are to be hidden. Is this at all possible?
I have envisioned a couple of scenario's to achieve this.
1. Some way to hide the values themselves.
2. Create a custom list, and a workflow to sync that value to the "Status" Property afterwards.
3. Create a custom list, and a JS Custom Task to sync set the status afterwards.
Has anyone done anything like this before?
Best Answers
-
Joe_Burrows Cireson Devops Super IT Monkey ✭✭✭✭✭Hi Fredrik
It is possible to hide enum values:Disabling/Hiding Enumerations
Sometimes it is necessary to disable or hide an enumeration from the Cireson Portal. The two most common cases are: 1) enumerations that are provided out of the box in SCSM that are in a sealed management pack and therefore cannot be modified but the enumerations are not wanted. Example: Service Request area enumerations or incident source enumerations. 2) An enumeration has been in use for some time and now needs to be "retired".
An enumeration can be disabled by making a database update to the ServiceManagement database as follows:
- The first step is to determine the enumeration ID of the enumeration that you want to disable. You can refer to the How To Determine the Root Enumeration GUID of an Enumeration Data Type Property knowledge base article for how to find enumeration IDs in general. Although that article was written to help find the *root* enumeration ID, the techniques can also be used to determine the ID of any enumeration.
- Once you have the enumeration ID of the enumeration that you want to disable, run the following query in the ServiceManagement DB:
UPDATE Enumeration SET Enabled = 0 WHERE EnumerationID = 'the ID'
- Restart the Cireson Portal web site.
6 -
Fredrik_Borchsenius Customer IT Monkey ✭Hi.
I sorted this by doing the following:
Created a custom list.
Created a new SR Form
Added the new list as "Status"
Made a new Custom Task to set the appropriate status when the new status is changed.7
Answers
Have you look at the following KB?
https://support.cireson.com/KnowledgeBase/View/24#/
It is possible to hide enum values:
Disabling/Hiding Enumerations
Sometimes it is necessary to disable or hide an enumeration from the Cireson Portal. The two most common cases are: 1) enumerations that are provided out of the box in SCSM that are in a sealed management pack and therefore cannot be modified but the enumerations are not wanted. Example: Service Request area enumerations or incident source enumerations. 2) An enumeration has been in use for some time and now needs to be "retired".
An enumeration can be disabled by making a database update to the ServiceManagement database as follows:
UPDATE Enumeration SET Enabled = 0 WHERE EnumerationID = 'the ID'
- Restart the Cireson Portal web site.
https://support.cireson.com/KnowledgeBase/View/24#/I sorted this by doing the following:
Created a custom list.
Created a new SR Form
Added the new list as "Status"
Made a new Custom Task to set the appropriate status when the new status is changed.
In case someone looks for a easy and fast script to hide the sealed enumerations:
$SCSMSQLServer = "YOUR_SERVER_NAME"
$SQLConnectionString ="Server=$SCSMSQLServer;Initial Catalog=ServiceManagement;Persist Security Info=False;Integrated Security=SSPI;"
$SQLconnection = New-Object System.Data.SqlClient.SqlConnection($SQLConnectionString)
$SQLconnection.Open()
$ServiceRequestAreaEnums = Get-SCSMEnumeration -Name ServiceRequestAreaEnum | ? {$_.DisplayName -ne 'Service Request Area'}
foreach($Enum in $ServiceRequestAreaEnums){
$SQLQuery = "UPDATE Enumeration SET Enabled = 0 WHERE EnumerationID = '$($Enum.Id)'"
$SQLCommand = New-Object System.Data.SqlClient.SqlCommand($SQLQuery,$SQLconnection)
$SQLCommand.ExecuteNonQuery()
}
$SQLconnection.Close()