Skip to content

Error with v3.4.3 #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gdbarron opened this issue Feb 23, 2023 Discussed in #222 · 3 comments · Fixed by #240
Closed

Error with v3.4.3 #234

gdbarron opened this issue Feb 23, 2023 Discussed in #222 · 3 comments · Fixed by #240
Assignees

Comments

@gdbarron
Copy link
Collaborator

Discussed in #222

Originally posted by DrMarkX December 20, 2022
From my question #192 I am now getting several 'ID' errors when using this line.
Get-ServiceNowRecord -Table sc_req_item -filter @('number', '-in', ($tasks.'request_item.number'[0..48] -join ',')) -IncludeCustomVariable -Property number -IncludeTotalCount

After several iterations of that error, the correct output is displayed.

Error
Get-ServiceNowRecord : Cannot validate argument on parameter 'ID'. Id must be either a 32 character alphanumeric, ServiceNow sysid, or prefix/id, ServiceNow number.
At C:\Program Files\WindowsPowerShell\Modules\ServiceNow\3.4.3\Public\Get-ServiceNowRecord.ps1:357 char:126

  • ... on.item_option_new.reference' -ID $var.'sc_item_option.value' -Proper ...
@gdbarron gdbarron self-assigned this Feb 25, 2023
@gdbarron
Copy link
Collaborator Author

@DrMarkX, I've found the issue, but unable to recreate. For some reason the reference value for a reference type custom variable is not a sysid, I have not seen this before. When the type is a reference, I've added in 'ReferenceTable' and error handling. I'm hoping this will help us narrow down the issue.

Can you test with the script you provided in the discussion and see which entries have a ReferenceTable value and 'Value' is not a sysid? The updated code can be found at https://github.com/Snow-Shell/servicenow-powershell/blob/234-error-with-v343/ServiceNow/Public/Get-ServiceNowRecord.ps1.

@gdbarron
Copy link
Collaborator Author

gdbarron commented Mar 9, 2023

Hi @DrMarkX, just following up, if/when you get time...

@DrMarkX
Copy link

DrMarkX commented Mar 20, 2023

I am so sorry I haven't responded. I did some testing, and the error is not showing. I also caught an issue where I was passing a null value to the user table - which also displayed error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants