none
New Hardware request via Service offering

    Question

  • We want to give users the possibility to request new hardware via the self service portal.

    • If we use the standard service request template then we are not able to map all our properties.
    • If we create a custom form with the authoring tool then we don’t have the activities tab for the approval of the request.
    • If we create extensions on the service request template then we will be ending up with so much extensions that it will unmanageable because we need service requests for hardware, movement, software,…requests.

    We also looked around for adding extra tabs but this got also limitations.

    So does anybody have an idea how to do this.

    Regards

    Geert

    Monday, October 01, 2012 9:00 AM

Answers

  • Okay, that's at least progress in the right direction :)

    This is because the components for the related items, history, activities tabs etc. are missing in the typeprojection definition. I thought you've excluded them from your forums post above for better readability...

    So I'd recommend to read the following blogpost from Anton which I've mentioned in my first post: http://blog.scsmsolutions.com/2012/05/propertyname-error-on-form-targeted-to-custom-class/

    The components for the standard Service Request are these:

     <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
                <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
              </Component>
              <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
              <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
            </TypeProjection>

    But you shouldn't just copy and paste them without checking the aliases  (the used aliases to other MPs may differ in your MP). Otherwise you'll get error message while importing saying there are double MP references or references are missing.

    In case your Alias reference list you've posted is complete you need to add the following references first:

          <Reference Alias="WorkItem">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CoreKnowledge">
            <ID>System.Knowledge.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SupportingItem">
            <ID>System.SupportingItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Catalog">
            <ID>System.ServiceCatalog.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    Then you can copy and paste the standard typeprojection components.

    Your typeprojection should then look like this:

    <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="HWClass" /> 
     <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
                <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
              </Component>
              <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
              <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
            </TypeProjection>
    </TypeProjections>

    This should fix the error you currently get.

    Cheers

    Alex



    • Edited by alexander.markel Wednesday, October 03, 2012 11:55 AM
    • Marked as answer by WTCBrummi Wednesday, October 03, 2012 12:01 PM
    Wednesday, October 03, 2012 11:50 AM

All replies

  • Hi Geert,

    Option 2 is imo in your case the best fit.

    You can create custom forms with the all the standard tabs (such as history, related items and the required activities tab) when you specify the Service Request Forms DLL library.

    From a highlevel perspective you'd need to do this:

    1. Create an inherited Service Request class and add all properties and relations you need for the service request fullfilment.

    2. Create a custom form and specify the Service Request Forms Assembly (Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.dll, is located in the install directory of the Authoring Tool in the Library\Service Request subfolder). Select as the form type "ServiceRequestForm".

    3. Now you should see standard Service Request form in the Auth Tool. You can now add all the labels, text boxes, lists, user pickers, etc. which you need to map them to the custom class properties and relations created in step 1.

    4. Save the MP but don't seal it yet.

    5. Open the XML with a XML editor and add the typeprojections of the standard Service Request form to your custom Service Request form (see also this blogpost from Anton: http://blog.scsmsolutions.com/2012/05/propertyname-error-on-form-targeted-to-custom-class/). This step is quite important as you'll otherwise receive an errormessage when you attempt to open your new form in the SCSM console and the console will crash.

    What you basically need to do here is to create a typeprojection for your form, add all the standard components of the standard Service Request and map the target of your form to the typeprojection. Anton has described in his blogpost how to get to the standard components.

    6. Save the raw modified XML and open it in the Auth Tool again. Seal the MP now.

    7. Create a MPB (Management Pack Bundle) file with the MP file + the referenced assembly for the form. You can use the MPBmaker cmdline tool Anton has published in the TechNet Gallery: http://gallery.technet.microsoft.com/MPB-Maker-743f85b9. Please ensure you've copied the DLL in the same folder where the MP file is stored.

    8. Import the MPB file in SCSM. Create a new Template for your custom Service Request class. Now the new form should get loaded and you're able to create these Hardware Requests using the template. 

    I'd defintely recommend to do all this first in a Test installation to check if the results are as desired.

    Hope this helps a bit and points you in the right direction.

    Cheers

    Alex

    Tuesday, October 02, 2012 10:03 AM
  • Dear Alexander,

    That's exactly what we are trying to do but i'm stuck on the Typeprojection part.this is my 

    - <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    - <Manifest>
    - <Identity>
      <ID>SC_SR_HW_Request_V1.0</ID>
      <Version>1.0.0.0</Version>
      </Identity>
      <Name>SC_SR_HW_Request_V1.0</Name>
    - <References>
    - <Reference Alias="System">
      <ID>System.Library</ID>
      <Version>7.5.8501.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    - <Reference Alias="Console">
      <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
      <Version>7.5.1561.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    - <Reference Alias="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26">
      <ID>System.WorkItem.ServiceRequest.Library</ID>
      <Version>7.5.1561.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      </References>
      </Manifest>
    - <TypeDefinitions>
    - <EntityTypes>
    - <ClassTypes>
    - <ClassType ID="HWClass" Accessibility="Public" Abstract="false" Base="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest" Hosted="false" Singleton="false" Extension="false">
      <Property ID="Property_35" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
      </ClassType>
      </ClassTypes>
      </EntityTypes>
      </TypeDefinitions>
    - <Categories>
    - <Category ID="SC_SR_HW_Request_V1.0.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>SC_SR_HW_Request_V1.0</ManagementPackName>
      <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
      </Category>
      </Categories>
    - <Presentation>
    - <Forms>
    - <Form ID="HWForm" Accessibility="Public" Target="HWClass" Assembly="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms" TypeName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.ServiceRequestForm">
      <Category>Form</Category>
      </Form>
      </Forms>
      </Presentation>
    - <LanguagePacks>
    - <LanguagePack ID="NLB" IsDefault="true">
    - <DisplayStrings>
    - <DisplayString ElementID="SC_SR_HW_Request_V1.0">
      <Name>SC_SR_HW_Request_V1.0</Name>
      </DisplayString>
      </DisplayStrings>
      </LanguagePack>
    - <LanguagePack ID="ENU" IsDefault="false">
    - <DisplayStrings>
    - <DisplayString ElementID="SC_SR_HW_Request_V1.0">
      <Name>SC_SR_HW_Request_V1.0</Name>
      </DisplayString>
    - <DisplayString ElementID="HWClass">
      <Name>HWClass</Name>
      <Description>Specify your class description.</Description>
      </DisplayString>
    - <DisplayString ElementID="HWClass" SubElementID="Property_35">
      <Name>Property_35</Name>
      </DisplayString>
    - <DisplayString ElementID="HWForm">
      <Name>HWForm</Name>
      <Description>Specify your form description.</Description>
      </DisplayString>
      </DisplayStrings>
      </LanguagePack>
      </LanguagePacks>
    - <Resources>
      <Assembly ID="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms" Accessibility="Public" FileName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.dll" HasNullStream="false" QualifiedName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </Resources>
      </ManagementPack>

    Tuesday, October 02, 2012 10:52 AM
  • If i add this then ik can not bundle it 

    <TypeProjections>
    <TypeProjection ID="HWClass" Accessibility="Public" Type="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest">
    </TypeProjection> 
    </TypeProjections>

    If  change it like this then i can bundle it but then I don't see my modifications and it looks like the default service request template, ik think because i break the realationship with the HWClass

    <Form ID="New_Hardware_Form" Accessibility="Public" Target="New_Hardware_TP"

    <TypeProjections>
    <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest">
    </TypeProjection> 
    </TypeProjections>

    Tuesday, October 02, 2012 11:07 AM
  • Okay, the last part with the Typeprojections looks correct.

    Please make sure you close your and all other SCSM Console sessions opened on that Management Server once after importing the MPB. We noticed the same behaviour that new changes won't appear until SCSM can completely reload that MP on startup...

    The standard behaviour of SCSM is to look through a chain for an appropriate form: first it looks if there's a form specified for your custom class -> if yes, load it. If not, check if for the parent class (which is the standard Service Request class) a form is existing -> if yes, load it..... etc. So that might be the reason why your form is not displayed.

    I'd also recommend to create a new template for your class and not to re-use the template in case you've already created one before the new MP was completely loaded.

    The other tabs on your custom Service Request are working correctly, right?

    Cheers

    Alex

    Tuesday, October 02, 2012 1:59 PM
  • Alexander,

    I can import the MP and create a new template without an error but I don't see the modifications I made with the authoring tool in the form.

    I think this is because i broke the link with my custom HWClass by renaming the Target from my Form ID to HWClass.

    My XML now looks like this

    - <
    - <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    - <Manifest>
    - <Identity>
      <ID>SC_SR_HW_Request_V1.0</ID>
      <Version>1.0.0.0</Version>
      </Identity>
      <Name>SC_SR_HW_Request_V1.0</Name>
    - <References>
    - <Reference Alias="System">
      <ID>System.Library</ID>
      <Version>7.5.8501.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    - <Reference Alias="Console">
      <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
      <Version>7.5.1561.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    - <Reference Alias="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26">
      <ID>System.WorkItem.ServiceRequest.Library</ID>
      <Version>7.5.1561.0</Version>
      <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      </References>
      </Manifest>
    - <TypeDefinitions>
    - <EntityTypes>
    - <ClassTypes>
      <ClassType ID="HWClass" Accessibility="Public" Abstract="false" Base="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest" Hosted="false" Singleton="false" Extension="false" />
      </ClassTypes>
    - <TypeProjections>
      <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest" />
      </TypeProjections>
      </EntityTypes>
      </TypeDefinitions>
    - <Categories>
    - <Category ID="SC_SR_HW_Request_V1.0.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>SC_SR_HW_Request_V1.0</ManagementPackName>
      <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
      </Category>
      </Categories>
    - <Presentation>
    - <Forms>
    - <Form ID="HWForm" Accessibility="Public" Target="New_Hardware_TP" Assembly="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms" TypeName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.ServiceRequestForm">
      <Category>Form</Category>
      </Form>
      </Forms>
      </Presentation>
    - <LanguagePacks>
    - <LanguagePack ID="NLB" IsDefault="true">
    - <DisplayStrings>
    - <DisplayString ElementID="SC_SR_HW_Request_V1.0">
      <Name>SC_SR_HW_Request_V1.0</Name>
      </DisplayString>
      </DisplayStrings>
      </LanguagePack>
    - <LanguagePack ID="ENU" IsDefault="false">
    - <DisplayStrings>
    - <DisplayString ElementID="SC_SR_HW_Request_V1.0">
      <Name>SC_SR_HW_Request_V1.0</Name>
      </DisplayString>
    - <DisplayString ElementID="HWClass">
      <Name>HWClass</Name>
      <Description>Specify your class description.</Description>
      </DisplayString>
    - <DisplayString ElementID="HWForm">
      <Name>HWForm</Name>
      <Description>Specify your form description.</Description>
      </DisplayString>
      </DisplayStrings>
      </LanguagePack>
      </LanguagePacks>
    - <Resources>
      <Assembly ID="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms" Accessibility="Public" FileName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.dll" HasNullStream="false" QualifiedName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </Resources>
      </ManagementPack>

    • Edited by WTCBrummi Wednesday, October 03, 2012 9:34 AM
    Wednesday, October 03, 2012 9:31 AM
  • Hi Geert,

    I just noticed the difference to my MP, which is working fine this way:

    The TypeProjection you've created must point to your own class. In your case it's referencing the System.WorkItem.ServiceRequest class through the Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26 alias.

    So try changing this line:

    <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="Alias_23d7a1ac_6e5f_411c_8d28_9103c9fc4e26!System.WorkItem.ServiceRequest" />

    to this:

    <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="HWClass" />

    Regards

    Alex

    Wednesday, October 03, 2012 11:20 AM
  • Alexander, 

    if i change it to <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="HWClass" /> then i can bundle and import the MP

    but when i create a template i got the System.ArgumentException: propertyName error


    • Edited by WTCBrummi Wednesday, October 03, 2012 11:28 AM
    Wednesday, October 03, 2012 11:28 AM
  • Okay, that's at least progress in the right direction :)

    This is because the components for the related items, history, activities tabs etc. are missing in the typeprojection definition. I thought you've excluded them from your forums post above for better readability...

    So I'd recommend to read the following blogpost from Anton which I've mentioned in my first post: http://blog.scsmsolutions.com/2012/05/propertyname-error-on-form-targeted-to-custom-class/

    The components for the standard Service Request are these:

     <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
                <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
              </Component>
              <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
              <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
            </TypeProjection>

    But you shouldn't just copy and paste them without checking the aliases  (the used aliases to other MPs may differ in your MP). Otherwise you'll get error message while importing saying there are double MP references or references are missing.

    In case your Alias reference list you've posted is complete you need to add the following references first:

          <Reference Alias="WorkItem">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CoreKnowledge">
            <ID>System.Knowledge.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SupportingItem">
            <ID>System.SupportingItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Catalog">
            <ID>System.ServiceCatalog.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    Then you can copy and paste the standard typeprojection components.

    Your typeprojection should then look like this:

    <TypeProjection ID="New_Hardware_TP" Accessibility="Public" Type="HWClass" /> 
     <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
                <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
              </Component>
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
                <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
              </Component>
              <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
              <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
              <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
            </TypeProjection>
    </TypeProjections>

    This should fix the error you currently get.

    Cheers

    Alex



    • Edited by alexander.markel Wednesday, October 03, 2012 11:55 AM
    • Marked as answer by WTCBrummi Wednesday, October 03, 2012 12:01 PM
    Wednesday, October 03, 2012 11:50 AM
  • Alex,

    A big thanks to you, this fixed the problem.

    We will post this solution as a reference on our blog http://dynamicdatacenter.wordpress.com/

    Regards 

    Geert & Gino

    Wednesday, October 03, 2012 12:05 PM
  • You're welcome! Glad it's working now properly.

    Cheers

    Alex

    Wednesday, October 03, 2012 12:48 PM
  • I've tried everything to get this to work, I'm just trying to create a service request with a different title (IT Tasks) with no real changes and no custom fields. I am kind of new to xml, any help would be greatly appreciated. I've been following this guide and have been trying for the last 3 days to get it working. http://dynamicdatacenter.wordpress.com/2012/10/03/add-custom-service-request-forms-in-servicemanager2012/ 

    Here are my Refs/Alias

    <References>
          <Reference Alias="System">
            <ID>System.Library</ID>
            <Version>7.5.8501.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Console">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Alias_b8a6fcb5_5ef9_475a_a504_f25b23c34b35">
            <ID>System.WorkItem.ServiceRequest.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
    	  <Reference Alias="WorkItem">
    <ID>System.WorkItem.Library</ID>
    <Version>7.5.1561.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    <Reference Alias="CoreKnowledge">
    <ID>System.Knowledge.Library</ID>
    <Version>7.5.1561.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    <Reference Alias="SupportingItem">
    <ID>System.SupportingItem.Library</ID>
    <Version>7.5.1561.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    <Reference Alias="Catalog">
    <ID>System.ServiceCatalog.Library</ID>
    <Version>7.5.1561.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
        </References>

    Here is my typeprojection

    <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="ITTaskClass" Accessibility="Public" Abstract="false" Base="Alias_b8a6fcb5_5ef9_475a_a504_f25b23c34b35!System.WorkItem.ServiceRequest" Hosted="false" Singleton="false" Extension="false">
              <Property ID="Property_35" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
            </ClassType>
    		</ClassTypes>
          	  <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
    </Component>
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
    </Component>
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
    <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
    </Component>
    <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
    <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
    </TypeProjection>
    </TypeProjections>
        </EntityTypes>
      </TypeDefinitions>
      <Categories>
        <Category ID="tasksform.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>tasksform</ManagementPackName>
          <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
        </Category>
      </Categories>
      <Presentation>
        <Forms>
          <Form ID="ITTaskForm" Accessibility="Public" Target="ITTaskClass" Assembly="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms" TypeName="Microsoft.EnterpriseManagement.ServiceManager.Applications.ServiceRequest.Forms.ServiceRequestForm">

    The error I get when opening the xml in XML+ Notepad is - The 'EntityTypes' start tag on line 47 does not match the end tag of 'TypeProjection'. Line 75, position 3.
    Line 47 = "<EntityTypes>"
    Line 75 ="</TypeProjection>"


    • Edited by WillNixo Thursday, December 06, 2012 10:53 PM
    • Proposed as answer by alexander.markel Saturday, December 08, 2012 12:11 AM
    • Unproposed as answer by alexander.markel Saturday, December 08, 2012 12:11 AM
    Thursday, December 06, 2012 10:49 PM
  • Hi,

    there's a XML starting tag missing in your XML code.

    Just browse to this code section

    </ClassTypes>
    <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass" />

    And insert between </ClassTypes> and <TypeProjection ID.....> the following tag:  <TypeProjections>

    It should then look like this:

    </ClassTypes>
    <TypeProjections>
    <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass" />

    Save the XML file and then this error message should disappear.

    Cheers

    Alex

    Friday, December 07, 2012 2:21 PM
  • Hi Alexander,

    Thanks for your reply, I have tried this and I'm still getting an error.
    The "TypeProjections" start tag on line 53 does not match the end tag of "TypeProjection"

    I've tried removing the </TypeProjection> end tag and swapping it around with </TypeProjections> end tag

        <EntityTypes>
          <ClassTypes>
            <ClassType ID="ITTaskClass" Accessibility="Public" Abstract="false" Base="Alias_b8a6fcb5_5ef9_475a_a504_f25b23c34b35!System.WorkItem.ServiceRequest" Hosted="false" Singleton="false" Extension="false">
              <Property ID="Property_35" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
            </ClassType>
    		</ClassTypes>
    		<TypeProjections>
          	  <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$" Alias="ClosedBy" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AboutConfigItem" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$" Alias="AffectedServices" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItems">
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
    </Component>
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemSource">
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" />
    </Component>
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments">
    <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" />
    </Component>
    <Component Path="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />
    <Component Path="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$" Alias="RelatedRequestOffering" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLog" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystCommentLog" />
    <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="EndUserCommentLog" />
    </TypeProjection>
    </TypeProjections>
        </EntityTypes>

    Sunday, December 09, 2012 9:39 PM
  • Hi there,

    aah I think I found the issue. Quite a small detail with a big impact :-)

    On the line...

    <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass" />
    

    ... you're already closing the <TypeProjection> tag with the last slash sign. Therefore the </TypeProjection> tag at the end is redundant. Closing the typeprojection tag directly with the 1st line is anyway an issue here as you have on the following lines the components defined which are contained by the typeprojection. SCSM wouldn't recognize where these components belongs to (it would surely thrown an exception anyway..)

    So, please try to remove the slash sign so that the line looks like this:

    <TypeProjection ID="ITTaskForm" Accessibility="Public" Type="ITTaskClass">
    

    This should hopefully sort your issue then :-)

    Cheers

    Alex

     
    Tuesday, December 11, 2012 7:40 AM
  • Hey Alex,

    All that over one slash, That has fixed my issue. Many thanks!!!!!!!!!!!!!!!

    Tuesday, December 11, 2012 11:10 PM
  • Alex,

    Thanks for all the help info in this post.  I'm performing the same steps as to what's provide above but have run into an issue.

    When I attempt to seal the mgmt pack, I receive a message that I have duplicate references for "Supporting Item" and "Work Item".  See below:

    <Reference Alias="CustomSystem_SupportingItem_Library">
            <ID>System.SupportingItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

     <Reference Alias="SupportingItem">
            <ID>System.SupportingItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    <Reference Alias="WorkItem">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>

    It appears when you create the from using the assembly it adds a referece to the "WorkItem" and "SupportingItem" mgmt pack using a custom reference name.  To resolve this issue, I removed the non-custom "WorkItem" and "SupportingItem" references and renamed and referece to them with the name of the custom reference.

    This seemed to work fine with no issue. The issue I'm now having, and I'm not sure if it's related, is that when I click on a new tab of my custom Service Request form, it won't show the new page.  It's as if the tab is a dead link.  When I first open the form I can see all the fields on the tab, but once I click away and try to come back nothing happens.  Have you ever encourtered this before?  Could it be related to the reference change I've made (it doesn't seem so but wanted to mention that)?

    Any help would be greatly appreciated as I don't know where to go from here.

    Tuesday, February 12, 2013 3:15 PM
  • Hey James,

    this sounds indeed very weird. I haven't encountered this yet, in none of our 3 SCSM environments.

    Have you had this MP already imported before you changed the references? If so, I'd try to recreate the templates for your custom SR classes. I've noticed once that certain templates haven't displayed the most current forms version (don't ask me how that's even possible, I don't have a clue either...), but after re-creating the SR templates it was fine again.

    Would you mind to share your Typeprojection XML code? I'll just check that against ours to see if there's something different....

    BR

    Alex

    Monday, February 18, 2013 8:26 AM
  • Hi Alex

    I created a new class with 4 list properties which I made mandatory in the CR form. I imported the MP with no issues, the required fields work and the workflow I created works as well. My problem is when I want to close, cancel, or put CR on hold I get the following error:

    Message: ChangeRequestStatusChangeTaskHandler has parameter that is not valid.

    Parameter name: node.DataTypeCCM_CustomCR

    System.ArgumentException: ChangeRequestStatusChangeTaskHandler has parameter that is not valid.

    Parameter name: node.DataTypeCCM_CustomCR

      at Microsoft.EnterpriseManagement.UI.SdkDataAccess.ConsoleTaskHandler.DoTask(IList`1 navigationNodes, NavigationModelNodeTask task, List`1 parameterList)

      at Microsoft.EnterpriseManagement.UI.SdkDataAccess.ConsoleTaskHandler.DoTask(IList`1 navigationNodes, NavigationModelNodeTask task)

      at Microsoft.EnterpriseManagement.ConsoleFramework.WindowJobRecord.ExecuteBackgroundJob(Object sender, ConsoleJobEventArgs eventargs)

      at Microsoft.EnterpriseManagement.ServiceManager.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)

    Any ideas?

    Thanks

    Julio B

    Thursday, November 21, 2013 6:03 PM
  • Hi Julio,

    I never created a new custom CR class yet, so I'm not really sure if this method which works with SRs is also applicable to CRs. But I'd assume it should work pretty similar. Have you any other custom developments related to CRs? Just from the error log it seems the task handler can't properly work with the received data from your custom CR node. Unfortunately I'm not very knowledged in C# so it's just a guess and I'm not even sure how to fix it.

    BR

    Alex

    Thursday, November 28, 2013 12:30 PM
  • Hi Alexander

    I would like to thank You as you helped me to solve a big issue with this page and your answers.

    but I have a question

    i have applied all you mentioned here and created customized classes and forms and every thing is working properly except the attachment field.

    when i create a request offering and include an attachment upload in it the file uploaded does not appear in the form.

    but if I try to upload it later from the my requests tab  it appear,

    do u have any solution for this


    Monday, April 11, 2016 11:47 AM