Public/Service/Tickets/New-CWMTicket.psm1

function New-CWMTicket {
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "")]
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')]
    param(
        [int]$id,
        [Parameter(Mandatory=$true)]
        [ValidateLength(1,100)]
        [string]$summary,
        $recordType,
        $board,
        $status,
        $project,
        $phase,
        [ValidateLength(1,50)]
        [string]$wbsCode,
        [Parameter(Mandatory=$true)]
        $company,
        $site,
        [ValidateLength(1,50)]
        [string]$siteName,
        [ValidateLength(1,50)]
        [string]$addressLine1,
        [ValidateLength(1,50)]
        [string]$addressLine2,
        [ValidateLength(1,50)]
        [string]$city,
        [ValidateLength(1,50)]
        [string]$stateIdentifier,
        [ValidateLength(1,12)]
        [string]$zip,
        $country,
        $contact,
        [ValidateLength(1,62)]
        [string]$contactName,
        [ValidateLength(1,20)]
        [string]$contactPhoneNumber,
        [ValidateLength(1,15)]
        [string]$contactPhoneExtension,
        [ValidateLength(1,250)]
        [string]$contactEmailAddress,
        $type,
        $subType,
        $item,
        $team,
        $owner,
        $priority,
        $serviceLocation,
        $source,
        [string]$requiredDate,
        [decimal]$budgetHours,
        $opportunity,
        $agreement,
        [int]$severity,
        [int]$impact,
        [ValidateLength(1,100)]
        [string]$externalXRef,
        [ValidateLength(1,50)]
        [string]$poNumber,
        [int]$knowledgeBaseCategoryId,
        [int]$knowledgeBaseSubCategoryId,
        [boolean]$allowAllClientsPortalView,
        [boolean]$customerUpdatedFlag,
        [boolean]$automaticEmailContactFlag,
        [boolean]$automaticEmailResourceFlag,
        [boolean]$automaticEmailCcFlag,
        [ValidateLength(1,1000)]
        [string]$automaticEmailCc,
        [string]$initialDescription,
        [string]$initialInternalAnalysis,
        [string]$initialResolution,
        [string]$contactEmailLookup,
        [boolean]$processNotifications,
        [boolean]$skipCallback,
        [string]$closedDate,
        [string]$closedBy,
        [boolean]$closedFlag,
        [string]$dateEntered,
        [string]$enteredBy,
        [decimal]$actualHours,
        [boolean]$approved,
        $subBillingMethod,
        [decimal]$subBillingAmount,
        [string]$subDateAccepted,
        [string]$dateResolved,
        [string]$dateResplan,
        [string]$dateResponded,
        [int]$resolveMinutes,
        [int]$resPlanMinutes,
        [int]$respondMinutes,
        [boolean]$isInSla,
        [int]$knowledgeBaseLinkId,
        [string]$resources,
        [int]$parentTicketId,
        [boolean]$hasChildTicket,
        $knowledgeBaseLinkType,
        $billTime,
        $billExpenses,
        $billProducts,
        $predecessorType,
        [int]$predecessorId,
        [boolean]$predecessorClosedFlag,
        [int]$lagDays,
        [boolean]$lagNonworkingDaysFlag,
        [string]$estimatedStartDate,
        [int]$duration,
        [int]$locationId,
        [int]$businessUnitId,
        [guid]$mobileGuid,
        $sla,
        $currency,
        $_info,
        $customFields
    )

    $URI = "https://$($script:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/tickets"
    return Invoke-CWMNewMaster -Arguments $PsBoundParameters -URI $URI
}