@@ -202,6 +202,41 @@ Describe "ServiceNow-Module" {
202202 $TestTicket.description | Should - Be ' Updated by Pester test Update-ServiceNowNumber works'
203203 }
204204
205+ It " Update-ServiceNowNumber with SpecifyConnectionFields works" {
206+ $ShortDescription = ' Testing Ticket Update with Pester'
207+ $newServiceNowIncidentSplat = @ {
208+ Caller = $Defaults.TestUser
209+ ShortDescription = $ShortDescription
210+ Description = ' Long description'
211+ AssignmentGroup = $Defaults.TestUserGroup
212+ Comment = ' Comment'
213+ Category = $Defaults.TestCategory
214+ SubCategory = $Defaults.TestSubcategory
215+ ConfigurationItem = $Defaults.TestConfigurationItem
216+ }
217+ $TestTicket = New-ServiceNowIncident @newServiceNowIncidentSplat
218+
219+ $TestTicket.short_description | Should - Be $ShortDescription
220+
221+ $Values = @ {
222+ ' short_description' = ' Ticket Updated with Pester (Update-ServiceNowNumber)'
223+ ' description' = ' Updated by Pester test Update-ServiceNowNumber with SpecifyConnectionFields works'
224+ }
225+
226+ $updateServiceNowNumberSplat = @ {
227+ Number = $TestTicket.Number
228+ Table = ' incident'
229+ Values = $Values
230+ Credential = $Defaults.Creds
231+ ServiceNowURL = $Defaults.ServiceNowURL
232+ }
233+ Update-ServiceNowNumber @updateServiceNowNumberSplat
234+
235+ $TestTicket = Get-ServiceNowIncident - MatchExact @ {sys_id = $TestTicket.sys_id }
236+ $TestTicket.short_description | Should - Be ' Ticket Updated with Pester (Update-ServiceNowNumber)'
237+ $TestTicket.description | Should - Be ' Updated by Pester test Update-ServiceNowNumber with SpecifyConnectionFields works'
238+ }
239+
205240 # Remove Functions
206241 It " Remove-ServiceNowTable works" {
207242 $TestTicket = Get-ServiceNowIncident - Limit 1
0 commit comments