CIRESON PORTAL: DYNAMIC FORMS BY TEMPLATE ID, PART 3

Following up our posts in this series from last week, today we are going to quickly show how we can set a template ID in a Service Request template so that the template ID is always set on SR creation.

Continue reading “CIRESON PORTAL: DYNAMIC FORMS BY TEMPLATE ID, PART 3”

Advertisements

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!

Automation Series 1, Part 4: Azure Automation

Summary

If you’ve been following along with our series you now have a beautiful Power BI dashboard for your incidents that is using real data injected directly into Power BI from SCSM using Powershell and the Power BI API.

All that to say, we are missing one very important capability, and that’s how we update the data regularly without the SCSM admin having to log into the system in the middle of the night to refresh the data for the CIO currently in the UK. This is where Azure Automation comes in.

Continue reading “Automation Series 1, Part 4: Azure Automation”

Automation Series 1, Part 3: Power BI Reporting

Summary

In the third post of our automation series we will focus on report and dashboard creation from within the Power BI web app. The intent of our dashboard today will be to show only a few key metrics:

  1. Incident creation by date
  2. Count of Incidents by classification
  3. Count of Incidents by Status

Continue reading “Automation Series 1, Part 3: Power BI Reporting”

Automation Series 1, Part 2: Powershell and Power BI

Summary

In the second part of our series we will be focusing on Power BI and how to access the API through Powershell, as well as the benefits of using the API. We will also discuss a few of the limitations that exist within the API currently that could limit what you want to do with the API.

This is part 2 in the series, if you are looking for the first post you can find it here:

Automation Series 1, Part 1: Service Manager Dashboards in Power BI through Azure Automation

Continue reading “Automation Series 1, Part 2: Powershell and Power BI”

Automation Series 1, Part 1: Service Manager Dashboards in Power BI through Azure Automation

Summary

This blog is the first in a series that I’ll be writing, starting today and continuing through the next few weeks, that will focus on how IT shops can easily automate the process of dashboard creation within Power BI and then present this information to their users in a very mobile friendly fashion through the Power BI app. Going a step further, we will use Microsoft’s Azure Automation in the cloud to run on-premise runbooks to collect the data from Service Manager and upload the data into Power BI using Powershell and the Power BI API.

Continue reading “Automation Series 1, Part 1: Service Manager Dashboards in Power BI through Azure Automation”