This blog post is intended for developers and people doing advanced customizations in Service Manager.
Not too long ago I shared a blog post called 'Understanding Lists/EnumerationValues: CI Status Example ’ which explained how you can make simple, quick modifications to lists using the main console and how you can add list items through Management Pack XML too. Sometimes these list taxonomies can be very large. Creating each one of them one by one in the console could be pretty time consuming if you have tens or even 100+.
One of our Microsoft Consulting Services consultants, Tomaz Cebul, had a great idea for a list item creator tool in Excel. He sent me a draft version of this to which I have added some things. Thanks Tomaz!
This spreadsheet allows you to enter in list item display names. Behind the scenes, some crazy Excel functions are building the management pack XML for you based on what you enter. Then all you have to do is copy the Management Pack XML out of the spreadsheet, paste it into a .xml file and import it into Service Manager.
Here is how you use the tool:
Note: this tool only works for English. If you need to localize the content into an additional language please see the blog post on Localizing Management Pack Content .
Note: you can extend more than one root in a single custom MP, but both roots must be in the same MP as in the example below.
Note: you can create up to 200 enum values per MP using this tool. If you need more than that you can do it as two different MPs or if you have some knowledge of Excel you can probably figure out how to unprotect the worksheet and make the table a little larger.
Here are some screen shots of an example I did in the tool:
This results in a management pack that looks like this:
<ManagementPack ContentReadable="true" SchemaVersion="1.1" OriginalSchemaVersion="1.1">
<Manifest>
<Identity>
<ID>MyCustomMP</ID>
<Version>1.0.0.0</Version>
</Identity>
<Name>My Custom MP</Name>
<References>
<Reference Alias="System.WorkItem.Incident.Library">
<ID>System.WorkItem.Incident.Library</ID>
<Version>7.0.5244.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
</References>
</Manifest>
<TypeDefinitions>
<EntityTypes>
<EnumerationTypes>
<EnumerationValue ID="CoffeeMachine.Enum" Accessibility="Public" Ordinal="0" Parent="System.WorkItem.Incident.Library!IncidentClassificationEnum"/>
<EnumerationValue ID="CoffeeMachine.Filters.Enum" Accessibility="Public" Ordinal="1" Parent="CoffeeMachine.Enum"/>
<EnumerationValue ID="CoffeeMachine.Drain.Enum" Accessibility="Public" Ordinal="2" Parent="CoffeeMachine.Enum"/>
<EnumerationValue ID="CoffeeMachine.Drain.Pipe.Enum" Accessibility="Public" Ordinal="3" Parent="CoffeeMachine.Drain.Enum"/>
<EnumerationValue ID="CoffeeMachine.Drain.Fitting.Enum" Accessibility="Public" Ordinal="4" Parent="CoffeeMachine.Drain.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.Enum" Accessibility="Public" Ordinal="5" Parent="CoffeeMachine.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.OutofCoffee.Enum" Accessibility="Public" Ordinal="6" Parent="CoffeeMachine.Coffee.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.CoffeeTastesBad.Enum" Accessibility="Public" Ordinal="7" Parent="CoffeeMachine.Coffee.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.CoffeeTastesBad.TastesWateredDown.Enum" Accessibility="Public" Ordinal="8" Parent="CoffeeMachine.Coffee.CoffeeTastesBad.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.CoffeeTastesBad.TooCold.Enum" Accessibility="Public" Ordinal="9" Parent="CoffeeMachine.Coffee.CoffeeTastesBad.Enum"/>
<EnumerationValue ID="CoffeeMachine.Coffee.CoffeeTastesBad.DoesntTasteLikeStarbucks.Enum" Accessibility="Public" Ordinal="10" Parent="CoffeeMachine.Coffee.CoffeeTastesBad.Enum"/>
<EnumerationValue ID="CalledCoffeeMachineRepairTechnician.Enum" Accessibility="Public" Ordinal="11" Parent="System.WorkItem.Incident.Library!IncidentResolutionCategoryEnum"/>
</EnumerationTypes>
</EntityTypes>
</TypeDefinitions>
<LanguagePacks>
<LanguagePack ID="ENU" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="CoffeeMachine.Enum">
<Name>Coffee Machine</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Filters.Enum">
<Name>Filters</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Drain.Enum">
<Name>Drain</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Drain.Pipe.Enum">
<Name>Pipe</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Drain.Fitting.Enum">
<Name>Fitting</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.Enum">
<Name>Coffee</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.OutofCoffee.Enum">
<Name>Out of Coffee</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.CoffeeTastesBad.Enum">
<Name>Coffee Tastes Bad</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.CoffeeTastesBad.TastesWateredDown.Enum">
<Name>Tastes Watered Down</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.CoffeeTastesBad.TooCold.Enum">
<Name>Too Cold</Name>
</DisplayString>
<DisplayString ElementID="CoffeeMachine.Coffee.CoffeeTastesBad.DoesntTasteLikeStarbucks.Enum">
<Name>Doesn’t Taste Like Starbucks"</Name>
</DisplayString>
<DisplayString ElementID="CalledCoffeeMachineRepairTechnician.Enum">
<Name>Called Coffee Machine Repair Technician</Name>
</DisplayString>
<DisplayString ElementID="MyCustomMP">
<Name>My Custom MP</Name>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPack>
Which is then imported and displayed in the UI like this:
Once these are imported you can of course manage them in the main console Library/Lists view which will update the management pack.
You can get the tool from here:
http://cid-17faa48294add53f.skydrive.live.com/self.aspx/.Public/Tools/EnumCreator.xlsx
If you have any issues, suggestions, or other comments about the tool, please leave a comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.