Public/Service/Tickets/New-CWMTicket.ps1
function New-CWMTicket { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "")] [CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')] param( [int]$id, [Parameter(Mandatory=$true)] [ValidateLength(1,100)] [string]$summary, [string]$recordType, [hashtable]$board, [hashtable]$status, $project, $phase, [ValidateLength(1,50)] [string]$wbsCode, [Parameter(Mandatory=$true)] [hashtable]$company, [hashtable]$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, [hashtable]$country, [hashtable]$contact, [ValidateLength(1,62)] [string]$contactName, [ValidateLength(1,20)] [string]$contactPhoneNumber, [ValidateLength(1,15)] [string]$contactPhoneExtension, [ValidateLength(1,250)] [string]$contactEmailAddress, [hashtable]$type, [hashtable]$subType, [hashtable]$item, [hashtable]$team, [hashtable]$owner, [hashtable]$priority, [hashtable]$serviceLocation, [hashtable]$source, [string]$requiredDate, [decimal]$budgetHours, [hashtable]$opportunity, [hashtable]$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, [string]$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, [string]$knowledgeBaseLinkType, [string]$billTime, [string]$billExpenses, [string]$billProducts, [string]$predecessorType, [int]$predecessorId, [boolean]$predecessorClosedFlag, [int]$lagDays, [boolean]$lagNonworkingDaysFlag, [string]$estimatedStartDate, [int]$duration, [int]$locationId, [int]$businessUnitId, [guid]$mobileGuid, [hashtable]$sla, [hashtable]$currency, [hashtable]$_info, [hashtable[]]$customFields ) $URI = "https://$($script:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/tickets" return Invoke-CWMNewMaster -Arguments $PsBoundParameters -URI $URI } |