Adding a custom field to Incident Forms

Today I had an interesting Request. A Customer came with the idea of adding an additional field to the Incident Form. It should hold the User that would report the Incident. Often the user reporting the Incident is not the one that has problems (e.g. when a Power User of a Branch Office reports Incidents for all Branch Office Users). If you want to keep information about the Reporting User and the Affected User, this guide shows you how. This is how the Solution would look like:

clip_image002

Update: See my Video about extending Classes and Incident forms here.

I start by creating a new Management Pack in the Authoring Tool. It will be used to store all customizations I will make for the default Incident Management. After the Management Pack is created I open the class “Incident” in the Class Browser. The Incident Management Pack is automatically opened when you show the details of the Incident Class.

clip_image004

Now I have to extend the default Class “Incident”.

clip_image006

Because the Incident Class is stored in a sealed Management Pack, I have to define in which unsealed Management Pack the extension will be saved and how the Extension Class will be called.

clip_image008

clip_image010

Now I am ready to add the needed relationship to the User Class. I have to define a unique ID for the new relation. I call it “ReportingUser”.

clip_image012

clip_image014

After the relation is created, the details can be configured as needed. It’s important to change the Target Class of the relationship to the Object Type you want to use in the relationship. In this example I want to add an Object from the User Class. Therefore I select “User” (default is “Object”).

clip_image016

Now we are ready to extend the default Incident Form. I choose it from the Form Browser and select “View”. After that, I select “Customize” to extend the Form. Again, I have to select an unsealed Management Pack to store the Customization.

clip_image018

clip_image020

clip_image022

clip_image024

The Form Customization Toolbox should open automatically. Because I have to place another User Picker on the form, I need some more space on it. One way to do it is to just move down one of the existing Objects on the form. I choose “Title” and configure a Top Margin of 60. This creates the needed space and moves all objects down.

clip_image026

Now I drag a Label and a User Picker Object to the empty space and configure them using the Details Settings. One important setting is to bind the User Picker to the relationship we configured in the first step. Otherwise the selected User cannot be stored in the Incident Form.

clip_image028

clip_image030

Now it’s time to import the Management Pack and test if the customization is working as expected. When I create a new Incident, I have the new field and can populate it with Objects of the User Class.

clip_image031

Update: See my Video about extending Classes and Incident forms here.

Regards
Marcel

This entry was posted in SCSM and tagged , , , , , , . Bookmark the permalink.

79 Responses to Adding a custom field to Incident Forms

  1. Pingback: System Center Service Manager information(blog) overview - System Center Service Manager

  2. Umang Anand says:

    HI there

    How do I link this file to the portal?

    Regards

    Umang

  3. Mike Bergin says:

    What if you wanted straight text in the additional field rather than a user. What would you use for your target class?

    • Hey

      Not exactly sure what you mean, but you can extend the incident with any property you want and bind this to a label or textbox control on the Incident form. The procedure would be almost the same …

      regards
      Marcel

  4. Pingback: Remove the extensions tab on the Incident form | SCSMfaq.ch

  5. Daniel Ruiz says:

    How would you make the field a required field and prevent the incident from being created if it was missing?

    • Hey

      You can indeed mark an additional incident property as required. the problem is that when you import the MP it will fail because the existing incidents dont have a value for that field. as a workaround you can set a default value for the required property, then it works. problem then is that even when creating new objects, they have this default value already set. If you create a new class you can mark properties as mandatory without setting a default value.

      regards
      Marcel

  6. Ozge Ozkaya says:

    Is it possible to make a custom form field required?

    Thanks in advance

    • Hey

      Yes and No. You can indeed mark an additional incident property as required. the problem is that when you import the MP it will fail because the existing incidents dont have a value for that field. as a workaround you can set a default value for the required property, then it works. problem then is that even when creating new objects, they have this default value already set. If you create a new class you can mark properties as mandatory without setting a default value.

      regards
      Marcel

  7. erickson says:

    Is this field added to the dababase ? ( and what table ) and if is not added how i can add this field thanks !

    • Hey

      Sorry for the delayed response – i was on holidays 🙂

      You should see a new table in the ServiceManager database called something like “dbo.MT_xxx” where xxx is the ID of the class extension.

      regards
      Marcel

  8. Simon says:

    Hi, i’m trying to make a custom form field “required” but can’t seem to manage it.

    i’ve followed the example in this post to add the custom field to the form, but i can’t see an obvious way to make it required.
    i’ve marked the relationship properties as required, but that doesn’t seem to affect the incident form.
    when i add a new item to the custom object the fields are marked as required there, but not on the incident or change request forms.

    any idea how i can acheive this?

    many thanks

    • Hey

      There’s no OOB way to mark those attributes as required. When you re-build the form from scratch or implement a hidden user control that does the check (both in Visual Studio) this would work.

      regards
      Marcel

      • Simon says:

        Hi Marcel,
        thanks for the reply, i will look at the hidden user control.
        although it might be as well for us to build a new form, as we have done some customisation.
        thanks for the help.
        Simon

  9. how this additional field can be use for reporting? Please reply urgent

  10. No, i didnt seal the MP. is it work if i seal it?

  11. Oscar Aguilar says:

    Hi Marcel, When i seal my MP and if i want to make another customization how can i unseal or i have to create new one ?

    • Hey

      You should always Keep an unsealed Version of your MP. This can be used if you later want to make any modifications to the MP.

      regards
      Marcel

  12. Nat says:

    Hi

    I followed your instructions on creating the relationship of the reporting user. How do I view reports on this in the data warehouse?

    Thanks
    Nat

    • Hey

      This needs some additional steps because you have to modify the Report Definitions. Myself, I dont have a walkthrough for this, but I’m sure you will find some out there …

      regards
      Marcel

  13. Trina says:

    Hi Marcel, If I make modifications to a previously modified MP (there was an unsealed version kept for this purpose) and then import and seal the new revised incident form with additional fields, will this change dates on the incidents created with the older version of the form? I am adding scheduled start and end date, but read somewhere that modifying the form can affect the created and other dates.
    Regards,
    Trina

  14. Wyatt Wong says:

    Can I create a custom “read-only” field with assigned a preset value to the custom “read-only” field ? If so, how to do this ?

    • Hey

      Depending on the exact needs you can use a label that is bound to a property … this can be done using the Authoring Tool. Just drag a label element to the Incident form and bind it to whatever property you want to display.

      regards
      Marcel

      • Wyatt Wong says:

        I know I need to use Authoring Tool to drag the field, but I don’t want to bind the custom field to a property, I only want to assign a string or numeric value (e.g. MyCustomeValue) to the custom field and then marked the custom field as “read only” such that nobody can change it. I plan to use Orchestrator to read the value in the custom field to perform something else.

        There seems no way to mark the custom field as read only and to assign a string or numeric value using the Authoring Tool.

      • Hey

        Where does the information live that you want to display?

        regards
        Marcel

  15. Wyatt Wong says:

    I want to create a view for “Review Activity” and “Manual Activity” and restrict the view to be seen by a particular group of persons. However, “Review Activity” and “Manual Activity” do not have a “Support Group” field similar to Incident Ticket, so I want to create a custom field and assigned a string value (e.g. “MyCustomValue”), then I can setup a filtering criteria in the view of “custom field equals to MyCustomValue”.

    To avoid the person who view the “Review Activity” or “Manual Activity” to modify the custom field, I want to make it as read-only

    • Hey

      Add a new property to the Activity Classes, then fill in a value based on your process. You dont have to display this on the form for doing the filtering because the users that work with the activity will not use it. Correct? Or add a label and bind it to the property.

      regards
      Marcel

  16. Jure Jeram says:

    Hello,

    I extended incident class, created a relationship for Reporting User and also added Reporting User on the incident form. Then I created a request offering where user can create an incident on behalf of another user. My question is this. Is it possible to somehow map this selected user to “Reporting User” in the incident form. Problem is that prompts output from the portal can only be mapped to a property and not to a relationship. Is there any other way to get this selected user to “Reporting User” relationship?

    Regards

  17. bandboy says:

    Hi Marcel.
    In the create incident form i want to hide an out of the box ‘incident classification’ dropdown that is required as default. I can change it to be hidden or greyed out but not change it to required=false. Is this expected behaviour? how can i remove this field as required so i can then remove it from the form?

  18. Oscar Aguilar says:

    Hi Marcel

    when i create a custom field, the table in the DB save the register as a catalog or save the register as a trasactional register and start to growing?

  19. Carlos says:

    Hi Marcel.

    Let say that I would like the Reporting User to be notificated aswell by mail with any update of the Work Item (via workflow).

    Since in the notificacion default I can only assign Creator User, Affected, Assigned, Closer… would It be any way to add this Custom fields as ones to be notificated aswell?

    Regards.

    Carlos

    • Carlos says:

      I was too eager in putting this post.

      After importing the MP, It let me in the workflows select “Report User” as to be notified.

      I checked that this “customization” only works from console, If I try to use it as a template for portal request, since the customization for the portal creates an unsealed MP, and the Incicent customization is unsealed too, they cannot be referenced.

      If I seal the Incident customization MP I guess that problem would be solved, still I don’t know how to map a prompt into the reporting user, I can put the field, make it search to users in the CMDB, but it won’t allow me to map that result to the Report User field.

  20. ronin8996 says:

    Forgive me if this has been answered, but can you create custom fields that are also logically related to other fields? For ex., we are currently using the Category field, but we have many to level categories, sub-categories, and further down, all which are selected in this singular field…so it can sometimes be complicated and makes reporting a little cumbersome.

    To help alleviate mistakes and reporting on this, it would be helpful to have a single ‘Category’ field, and then many a Subcategory (or 2) field with only data applicable to the category. (So maybe if the Category was ‘Networking’, the subcategories would only have defined fields for Networking, and so on.

    For ex, if instead of in the Category field have essentially

    Helpdesk\Troubleshooting\Break-Fix

    Have:
    Category: Helpdesk
    SubCategory: Troubleshooting
    2nd Ties Sub: Break-Fix

    Also if this would be able to be reported on via the odc file that would be great.

    I know other service-desk softwares have this capability, but not sure about SCSM yet (still new to it).

    Thanks!
    A

    • Hey

      This is not possible with basic customizations. However, if you are willing to develop some more complex things in Visual Studio, this is indeed possible.

      Cheers
      Marcel

  21. Madininarawak says:

    Hi Marcel,

    I follow your post and it is very helpfull…
    I have another question related this post.
    In my incident form, I have the affected user and I need display in a field the location of this userthat is recovered by a field called office in my AD User form.
    How can I do it and li nk my field to my affected user ?

    Regards
    Philippe
    Madininarawak

  22. Hey

    If the information that you want to display is available on the User CI in the CMDB, just add a label control to the incident form and bind it to that property.

    Cheers
    Marcel

  23. Excellent blog, a must for beginning to learn about the Authoring Tool. For some helpful ways to add new Labels and Controls exactly where you want it, go to http://www.cireson.com/scsm/adding-a-field-to-the-right-of-an-existing-field-scsm-2012-authoring-tool/

  24. Mattthew says:

    I am trying to get an AD Attrubute on the Incident form for our users phone extension in AD. It is a field called IPPhone. Is there a way to add this to our incident form?

  25. Anthony says:

    Hi Marcel,

    Thanks very much for the blog and for the videos. They are really helpful.

    I have a need for two Incident screens, with different fields on each. For example, one Incident type only needs to capture 10 pieces of data, whereass another needs 15.

    Do you know if there is a way to have two incident screens, configured for each type as opposed to extended the default class and screen to include the combined list of fields.

    cheers,
    Anthony.

    • Hey

      1 Class (Incident) can only have 1 form assigned to it. The only thing that would work is create a new Incident class that derives from the default Incident class and then create a custom form for that new class. The downside then is that you have 2 different Incident classes.

      Cheers
      Marcel

  26. Hazeeb says:

    Hi,
    Is it possible to add a field where i can upload picture and display it as a thumbnail pic. I need it for Configuration Items for asset management.
    Thanks in advance.

  27. Wyatt Wong says:

    I have added a custom field and put it in the Incident Form for testing purpose, the custom field was saved to a custom management pack and it was sealed. Now I found that I don’t need it and want to remove it. However, when I remove the MP, I got the following error:

    =====
    There are other management packs that depend on the management pack you are trying to delete. To view the dependent management packs, open the properties for this management pack. Delete all dependent management packs before trying to delete this management pack again.
    =====

    After checking, I found a lot of currently used management packs were in the dependent list. What should I do ?

    • Hey

      It seems that you have references in other MPs. That could be a template that uses the class defined in your MP. If so, all those objects must be deleted. Then remove the references to the MP that you want to delete. For that you can export the MP and remove the reference using a XML editor. Then reimport the MP.

      Cheers
      Marcel

  28. Leonardo Cordoba says:

    Hi Marcel,

    The company is installed Service Manager 2012 SP1, in the form of incidents created a list type field, which is visible to the record of the incident, even in the database not created this field cubes and what is not .

    My question is: Where to store the fields that are created with authoring tools in the database the Service Manager and who are can be accessed on the cubes.

    • Hey

      Did you create an Outrigger for the list?

      Cheers
      Marcel

      • leonardo cordoba says:

        no, marcel, which I think was just the list type field as shown in the images, in ste times already found the field created in the transactional database service manager, per not find the relationship between the incident id and field recorded in the database datamart. Example:

        Field: Incident_agencia: New york (Origin of the incident)
        Field: Id incident: IN-3020

        Relationship:
        IN -3020 – New york

        thank you very much

      • leonardo cordoba says:

        Not created an Outrigger for the list, it is new, what was done was make the step described in his blog.

        I suggest if you can create a new field in this field formualrio and place it in the datamart database and make a report sent to excel cube.

        Thank you very much.

  29. Julio B says:

    Marcel – I’m new to this. I created a new class, fields and a new form as per your intructions. I made the fields required. I bundled the management pack and imported it. When I attempt to create a template with the new class I created the console crahes when loading the form. Here is the error I get: An error was encountered while running the Service Manager Console. The console will now close.
    Here is the error log:
    System.ArgumentException: source
    at Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.EnterpriseManagementObjectProjectionDataType.AddTypeProjectionInTypeProjectionDefinition(IDataItem source, IDataItem typeProjection, Boolean overwrite)
    at Microsoft.EnterpriseManagement.GenericForm.FormUtilities.FetchAndMergeSubProjectionAsync(IList`1 emoProjections, Guid subProjectionId, AsyncCallback postCallback, Boolean mergerSubTypeProjection, Boolean overwriteComponents, Boolean fetchSubProjection)
    at Microsoft.EnterpriseManagement.GenericForm.FormUtilities.FetchAndMergeSubProjectionAsync(IList`1 emoProjections, Guid subProjectionId, AsyncCallback postCallback, Boolean mergerSubTypeProjection, Boolean overwriteComponents)
    at Microsoft.EnterpriseManagement.GenericForm.FormUtilities.FetchAndMergeSubProjectionAsync(IList`1 emoProjections, Guid subProjectionId, AsyncCallback postCallback, Boolean mergerSubTypeProjection)
    at Microsoft.EnterpriseManagement.GenericForm.FormUtilities.FetchAndMergeSubProjectionAsync(IList`1 emoProjections, Guid subProjectionId, AsyncCallback postCallback)
    at Microsoft.EnterpriseManagement.GenericForm.FormUtilities.FetchAndMergeSubProjectionAsync(IDataItem emoProjection, Guid subProjectionId, AsyncCallback postCallback)
    at Microsoft.EnterpriseManagement.ServiceManager.ChangeManagement.Forms.ChangeRequestForm.ChangeRequestDataContextChanged(Object sender, DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyPropertyChangedEventHandler.Invoke(Object sender, DependencyPropertyChangedEventArgs e)
    at System.Windows.FrameworkElement.RaiseDependencyPropertyChanged(EventPrivateKey key, DependencyPropertyChangedEventArgs args)
    at System.Windows.FrameworkElement.OnDataContextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
    at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
    at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
    at System.Windows.FrameworkElement.set_DataContext(Object value)
    at Microsoft.EnterpriseManagement.UI.FormsInfra.FormViewController.b__16()
    at Microsoft.EnterpriseManagement.UI.FormsInfra.FormViewController.OnReadHelperPropertyChanged(Object sender, PropertyChangedEventArgs e)
    at Microsoft.EnterpriseManagement.UI.ViewFramework.SupportClassBase.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
    at Microsoft.EnterpriseManagement.UI.ViewFramework.SingleItemSupportClass.NewDataAvailable(Object sender, DataEventArgs e)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
    at System.Windows.Threading.DispatcherOperation.InvokeImpl()
    at System.Threading.ExecutionContext.runTryCode(Object userData)
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Window.ShowHelper(Object booleanBox)
    at System.Windows.Window.Show()
    at System.Windows.Window.ShowDialog()
    at Microsoft.EnterpriseManagement.ConsoleFramework.WindowManager.GenericWpfWindowConstructor.BeginShow(ShowViewContext showViewContext, Object parent, Object view, AsyncCallback callback, Object state)
    at Microsoft.EnterpriseManagement.ConsoleFramework.ViewConstructor.BeginShow(ShowViewContext showViewContext, AsyncCallback callback, Object state)
    at Microsoft.EnterpriseManagement.ConsoleFramework.WindowManager.WpfWindowRecord.ShowWindow()
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()

    Any help appreciated on this. Thanks

    Julio B

  30. Fabian says:

    Hi Marcel,

    i added a field the same way you did.
    But now I want to generate a report on the basis of this field.
    What do I have to do now? Where can I find the field, cause it is not stored in the IncidentDim.

    Thanks you for helping!
    Fabian

  31. Ozge says:

    Hi Marcel,

    I am using SCSM 2012 SP1 Cu4. I have extended the Incident class and form. I added new tabs on the Incident form using Tab Item in the Authoring Tool . When I import the MP.xml, the new tabs are not displayed. Only the extension tab with custom properties.

    What am I missing?

  32. Tracy says:

    Hello Marcel, I have extended the Incident class to add a new enum property for my incident form. I also need it for my custom report. But in the database I cannot find my extended class, that is why I cannot run any query base on this property. Did I forget something? I would be happy if you can give me a hint.

    • Hey

      – Is the MP where the list is stored sealed?
      – Is the MP successfully synced to the DWH?
      – Did you create an outrigger?

      Cheers
      Marcel

    • Tracy says:

      Should I place the enum property in a separate MP too? So I just need to seal it and I won’t lose all my config because I don’t have to replace my existing MP.

  33. Enum (Root) should be placed in a sealed MP. The values of the list however should stay in an unsealed MP, so that they can be modified (if needed) from the Console.

  34. Simon says:

    Hi Marcel,

    great blog.

    I have extended the Service Request class with some properties and a list. I am trying to query the Service Manager database to find the list item that is associated with a particular service request.

    In the dbo.MT_ClassExtension_xxx table I can see all the fields.

    The simple data types have values in there that I can query directly, but the list type only has a GUID. Where is the linked table that actually holds the related list data?

    Thanks,

    Simon.

    • Hey Simon

      List values are always displayed as a GUID. Why? Because the database has a value for the same GUID in different languages. If you want to display the correct string in your prefered language you need to join the DisplayStrings View/Table and filter based on your language code. To make sure you have this translation available you might also need to create an outrigger to bring your list details over to the DWH.

      Hope this works for you!
      Cheers, Marcel

  35. hzeitoun says:

    Hello,
    Thanks for the procedure. I went thru the steps an added “Department” as custom field. Now how can I connect this field to Active Directory, like the users’ field.
    Regards,
    Hussam

    • Hey

      You could for instance show the department field of the affected user on the IR form. For this just add a Label (or TextBox) and configure the proper binding to the AD User property “department”.

      Cheers
      Marcel

  36. Joe says:

    Thank you for this blog. I am new here and I have a same request for service requests. I was following your example but just on service requests. When i got to binding I noticed that “requested by user” (or something like that)is already there out of the box. Just wondering if I can use that. Also if I seald MP and import it how can I update it later?If I keep unseld MP can I update it , seald it again and import it again with the same name. I also have one seald MP and I did not save unseald MP before i seald and imported to SCSM. Would I be able to export seald MP , update it with authoring tools , seal again and import it back?

    • Hey

      If you seal your MP and Import it, you can always update the unsealed Version of the MP with your authoring Tools. After the modification, seal it again and Import it “over” the already existing MP. That works find as Long as you do not remove entity type Information from the MP. If you only have the imported, sealed MP, Export it from the console and you will get an unsealed Version of it.

      Cheers
      Marcel

  37. mponsot says:

    Hi marcel,
    I tried to apply this procedure (creating a new Relationship, adding a user picker & binding it to my relationship then sealed the mp).
    However in the console when I add a user using this picker I can save my IR but, if I open it back the field is empty. In the history tab there is no mention of adding a new relation.

    Have you seen this behvior ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s