Home General Discussion

Incident Template with Status closed

Raffael_JenzerRaffael_Jenzer Customer IT Monkey ✭
I would like provide our analysts the possibility to create an Incident with Status closed.

Target: When they click on "New -> Work Item -> Incident -> From Template -> IR: closed", then the Incident form should open, the should be able to fill out description etc... and then on "Create". The Indicent should afterwards have the status closed.

I've already tried to create a new template, export ManagementPack, changed the ObjectTemplate:
 <ObjectTemplate ID="ObjectTemplate.8cb93bd47f624ee79172d099d0f92c9c" TypeID="IncidentManagement!System.WorkItem.Incident.ProjectionType">
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Escalated$">False</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Source$">$MPElement[Name='CustomSystem_WorkItem_Incident_Library!IncidentSourceEnum.Portal']$</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Status$">$MPElement[Name='CustomSystem_WorkItem_Incident_Library!IncidentStatusEnum.Closed']$</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/NeedsKnowledgeArticle$">False</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/TierQueue$">a153a330-e2f8-0f44-963f-e7d4b3cfbbc0</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/HasCreatedKnowledgeArticle$">False</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Incident_Library!System.WorkItem.Incident']/Classification$">245ad2a4-c472-e323-b876-1d060924e3cb</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket']/Impact$">$MPElement[Name='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket.ImpactEnum.Medium']$</Property>
      <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket']/Urgency$">$MPElement[Name='CustomSystem_WorkItem_Library!System.WorkItem.TroubleTicket.UrgencyEnum.Medium']$</Property>

But i'm not able to import the MP back again...

Any ideas?



  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    What error are you getting when trying to import the MP?

    I'm not sure, but you probably need to include relationships for ClosedbyUser and ResolvedByUser (as Closed status can only be set on a Resolved ticket).

    But when creating the template, you can just set the status to closed right away (instead of in the MP afterwards), by using the "Change Incident Status" task, select Other and select Closed. Fill out any other fields you need and save that template. I just tried it, and it gave me the following MP (cleared for personal info):

    <ObjectTemplate ID="Template.6bd439fe4d3a48d2a8f5045fa116a8fc" TypeID="Incident!CustomForm_f54d4ec8_6755_44cd_a20d_d9bd1093296e_TypeProjection">

  • Raffael_JenzerRaffael_Jenzer Customer IT Monkey ✭
    I tried it and i've set the template to "resolved". But then, alway my user is in the IR as the "resolved by" user.......
  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    Does it still show your user after you save the IR and then open it again?
  • Raffael_JenzerRaffael_Jenzer Customer IT Monkey ✭

    1) Template
    2) Template
    3 - 9) Create IR from Template and fill out and save (with MY User/Analyst)
    10 - 15) Create IR from Template and fill out and save (with OTHER User/Analyst)

    Also the "time/date" is from the Template (14:50)... 
  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    Unfortunately it seems to be a SCSM limitation. For some reason, it doesn't behave that way when you apply a template, but it seems to do when you create based on a template. If you don't use the ResovedBy field for any statistics, you could simply remove the Action Log entry from the MP to reduce confusion, by deleting the two <Object>-tags and their content.

    But if you do use the field, the only way I can think of fixing this is with a PS script or Orchestrator, where you could catch newly created IRs with status Closed (or on a custom class just for this, if you have it) and set the user from CreatedBy to be ResolvedBy.
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Another method: Create an IR template that is 'Active' with a PowerShell activity that runs code to set the status to Closed.
Sign In or Register to comment.