manifests/collectors/General/SupportTickets.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Management/SupportTickets.ps1 (AB#5660).
# Field expressions are copied verbatim from the original collector and evaluate in an
# equivalent scope -- see docs/design/decisions/declarative-collectors.md.
# Review before trusting; regenerate rather than hand-patch if the source collector changes.
#
@{
    ResourceTypes = @(
        'Microsoft.Support/supportTickets'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
                $data = $1.PROPERTIES
 
                $timecreated = if ($data.createdDate) { ([datetime]$data.createdDate).ToString("yyyy-MM-dd HH:mm") } else { '' }
                $ProblemDate = if ($data.problemStartTime) { ([datetime]$data.problemStartTime).ToString("yyyy-MM-dd HH:mm") } else { '' }
                $ModDate = if ($data.modifiedDate) { ([datetime]$data.modifiedDate).ToString("yyyy-MM-dd HH:mm") } else { '' }
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Support Ticket'
            Expression = '$data.supportTicketId'
        }
        @{
            Name = 'Title'
            Expression = '$data.title'
        }
        @{
            Name = 'Support Plan'
            Expression = '$data.supportPlanType'
        }
        @{
            Name = 'Service'
            Expression = '$data.serviceDisplayName'
        }
        @{
            Name = 'Current Severity'
            Expression = '$data.severity'
        }
        @{
            Name = 'Status'
            Expression = '$data.status'
        }
        @{
            Name = 'Creation Date'
            Expression = '$timecreated'
        }
        @{
            Name = '24/7 Response'
            Expression = '$data.require24X7Response'
        }
        @{
            Name = 'Ticket SLA (minutes)'
            Expression = '$data.serviceLevelAgreement.slaMinutes'
        }
        @{
            Name = 'Problem Start Date'
            Expression = '$ProblemDate'
        }
        @{
            Name = 'Last Modified Date'
            Expression = '$ModDate'
        }
        @{
            Name = 'Support Engineer'
            Expression = '$data.supportEngineer.emailAddress'
        }
        @{
            Name = 'Ticket Contact Name'
            Expression = '($data.contactDetails.firstName + '' '' + $data.contactDetails.lastName)'
        }
        @{
            Name = 'Ticket Contact Email'
            Expression = '$data.contactDetails.primaryEmailAddress'
        }
        @{
            Name = 'Ticket Contact Country'
            Expression = '$data.contactDetails.country'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
    )

    Export = @{
        WorksheetName = 'Support Tickets'
        TableNamePrefix = 'TicketsTable_'
        Columns = @(
            'Support Ticket'
            'Title'
            'Support Plan'
            'Service'
            'Current Severity'
            'Status'
            'Creation Date'
            '24/7 Response'
            'Ticket SLA (minutes)'
            'Support Engineer'
            'Problem Start Date'
            'Last Modified Date'
            'Ticket Contact Name'
            'Ticket Contact Email'
            'Ticket Contact Country'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @(
            'New-ConditionalText Open -Range F:F'
        )
    }

    SourceCollector = 'Modules/Public/InventoryModules/Management/SupportTickets.ps1'
}