Description
Environment
Operating System: windows server 2019
ServiceNow module version: 4.0.3
PowerShell version: 5.1.17763.5576
Hi,
thanks for the module. it is really helpful.
However, it seems there is something wrong for some table more especially dmn_demand_task.
Steps to reproduce
when using update-servicenowRecord specifically for dmn_demand_task
the table used by GET is correct but not by PATCH, we can see that from the original table dmn_demand_task, the table is "converted" to demand task
Expected behavior
dmn_demand_task updated properly
Actual behavior
input table dmn_demand_task "converted" into demand task
Screenshots
Update-ServiceNowRecord -values @{"work_notes"= "test"} -PassThru -Table dmn_demand_task -id DMNTSK0000374 -Verbose
VERBOSE: New-ServiceNowQuery - Advanced
VERBOSE: {
"ContentType": "application/json",
"UseBasicParsing": true,
"Method": "Get",
"Uri": "https://xxx.service-now.com/api/now/table/dmn_demand_task",
"Credential": {
"UserName": "..."
},
"Body": {
"sysparm_display_value": "true",
"sysparm_limit": 10,
"sysparm_fields": "sys_class_name,sys_id,number",
"sysparm_query": "number=DMNTSK0000374"
}
}
VERBOSE: GET https://xxx.service-now.com/api/now/table/dmn_demand_task?sysparm_display_value=true&sysparm_limit=10&sysparm_fields=sys_class_name%2Csys_id%2Cnumber&sysparm_query=number%3DDMNTSK0000374 with 0-byte payload
VERBOSE: received -1-byte response of content type application/json;charset=UTF-8
DEBUG: {"result":[{"sys_id":"04e613ab871b6150b216c8040cbb35d4","number":"DMNTSK0000374","sys_class_name":"Demand Task"}]}
VERBOSE: Total number of records for this query: 1
VERBOSE: Performing the operation "Update values" on target "Demand Task 04e613ab871b6150b216c8040cbb35d4".
VERBOSE: {
"ContentType": "application/json",
"UseBasicParsing": true,
"Method": "Patch",
"Uri": "https://xxx.service-now.com/api/now/table/Demand Task/04e613ab871b6150b216c8040cbb35d4",
"Credential": {
"UserName": "..."
},
"Body": [
123, ...
]
}
VERBOSE: PATCH https://xxx.service-now.com/api/now/table/Demand Task/04e613ab871b6150b216c8040cbb35d4 with -1-byte payload
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\ServiceNow\Private\Invoke-ServiceNowRestMethod.ps1:144 char:21