SCSMObjectTemplate

Mar 24, 2016 at 9:20 AM
Hello, I have scrpit to make the service request and work fine, but form yesterday ist return some error.

I can made te SR, but when i what set the template for it:
$serviceRequest_SD1_TypeProjection = Get-SCSMTypeProjection -name System.WorkItem.ServiceRequestProjection$
$serviceRequest_SD1_Projection = Get-SCSMObjectProjection -ProjectionName $serviceRequest_SD1_TypeProjection.Name -Filter "Id -eq $ServiceRequest_SD1_ID"
$serviceRequest_SD1_Template = Get-SCSMObjectTemplate | Where-Object {$_.ID -eq "e0728326-9031-2e11-b3a1-dc5d8289e4ee"}
Set-SCSMObjectTemplate -Projection $serviceRequest_SD1_Projection -Template $serviceRequest_SD1_Template
First third lins work ok, buy last of them return:
Set-SCSMObjectTemplate : The given key was not present in the dictionary.
At line:1 char:1
Set-SCSMObjectTemplate -Projection $serviceRequest_SD1_Projection -Template $ser ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : InvalidOperation: (Template.60c992...45996818be9b3bc:ManagementPackObjectTemplate) [Set-SCSMObjectTemplate], KeyNotFoundException
FullyQualifiedErrorId : ApplyTemplate,SMLets.SetSCSMObjectTemplateCommand
I have no idea why. That day i imported someone management pack pack but that template is in another one and they are not connected.