Advanced Request Offering – Last Modified Date Solution

Wanted to bring this to everyone’s attention that might be using Cireson’s advanced RO or looking forward to using it as they upgrade to the recently released version 5.0.

Basically, when you install the ARO MP it overwrites the last modified dates on all work items as it adds the required properties for the ARO to function. While this is a major load on the system, for some customers this is a critical issue in terms of how they manage their work items.

A crafty customer came up with a solution on his own and you can find it here:

https://gallery.technet.microsoft.com/SCSM-Last-Modified-Date-15425cdc

Customers always amaze me, and this is a great example of that! Good work!

Advertisements

Lost Single Item Array in Powershell Array to JSON Conversion

I thought I would throw this out there for anyone possibly running into this issue. Basically, when converting a PSObject to JSON in Powershell, I had an array that only had one value in some cases. When this happened the conversion would unpack the array and I would get the @{} at the root level of the property instead of an array:

Continue reading “Lost Single Item Array in Powershell Array to JSON Conversion”

Error Installing the Service Manager 2012 R2 Authoring Tool on Windows 2012 R2

Quick post today. Some of you may have run into this issue previously and while I figured this out myself this morning there also appears to be a technet article here talking through it in more detail.

In summary, if you have an issues with the VS 2008 Redist now showing as an install pre-req when trying to install the Authoring Tool, it’s most likely because the Redist actually didn’t install, as it doesn’t always install just by running the package as you’d expect.

To resolve this, browse to the C:\VS 2008 Shell Redist\Isolated Mode folder that the AppEnvRedist.exe created and run the vs_shell_isolated.enu.exe directly.

After the installation completes attempt the Authoring Tool install again and you should be good to go.

2016-02-10_10-37-36

Modify WorkItem Title When Creating Via Template / Projection

Quick one today. I ran into a bit of an issue when creating a new SR via an object projection and applying a template.

#projection setup
$TemplateObject = Get-SCSMObjectTemplate -Id $TemplateId
$TemplateMP = $TemplateObject.GetManagementPack()
$mpAlias = $TemplateMP.References.GetAlias((Get-SCSMManagementPack system.workitem.library))
foreach ($obj in $TemplateObject.ObjectCollection)
{
   fn_UpdatePropertyCollection -Object $obj -Alias $mpAlias
}

#get the new status for workflows
$statusNewEnum = Get-SCSMEnumeration ServiceRequestStatusEnum.New

$seedTypeSR = '^System.WorkItem.ServiceRequestProjection$'
$seedclassSR = Get-SCSMClass -Name System.WorkItem.ServiceRequest
$seedPropertyValuesSR = @{
CreatedDate = (Get-Date)
   Id = "SR{0}";
   Status = $statusNewEnum;
   Title = $afUser.DisplayName
}

$seedProjectionSR = @{
   __CLASS = "System.WorkItem.ServiceRequest"
   __OBJECT= $seedPropertyValuesSR
   CreatedBy = $AffectedUser
   AffectedUser = $AffectedUser
   AssignedTo = $AssignedUser
}

$newSrProjection = New-SCSMObjectProjection -Type $seedTypeSR -Projection $seedProjectionSR -Template $TemplateObject -PassThru -ErrorAction SilentlyContinue

When the template was applied it was overwriting my title. To remedy this, I had to dynamically modify the title within the template itself using this code:

#update the template title with the affected users displayname
foreach ($obj in $TemplateObject.PropertyCollection){
   if($obj.Path -like '*Title$'){
      $obj.MixedValue = $afUser.DisplayName + " - " + $obj.MixedValue
   }
}

Hope this helps someone else!

Cireson Portal: Dynamic Forms by Template ID, Part 2

Continuing from our last article we are going to move forward with the process of automating the display of our designated custom tab, but first lets do a quick review.

The last entry is available here: Part 1

Last time we worked through the basics of why you would want to use a solution like this, as well as how we can customize a portal form to display our custom property extensions for the workitem classes, and now we are going to discuss how we can manipulate the form on load to display the custom tab automatically based on the template id of the form.

Continue reading “Cireson Portal: Dynamic Forms by Template ID, Part 2”