Closed twproject closed 10 months ago
'403 Forbidden' - This is a permission related error message. I would lookup the official docs for the API and read up on the headings covered by 'REST API Security', 'REST API Roles' etc. It appears that whatever account you're using the access the API does not have write permission to that table.
If you have the ability in dev, for testing purposes, I would give the account full admin permissions and see if it still persists, if it doesnt you know for sure it's permission related, at which point you can remove admin and strip it back to what is required - although I'm not sure what you'd need on that front, each instance is configured different and i'm a little rustry, havent worked with SNOW for quite some time now.
Regarding how to fill those custom fields, I'd refer you to the docs for this module: https://github.com/insomniacc/PSSnow/blob/main/docs/UserGuide.MD#new-snowobject
Take a look at using a hashtable and the -properties parameter.
Thanks for the quick tips, the user had the correct rights and with New-SNOWObject i'm now able to create the incident.
I'll test again with New-SNOWIncident but I don't understand if with this function i'm able to fill custom fields.
@twproject - I think you may be confusing my comment a little, so the document I referenced for New-SnowObject was'nt a suggestion to use that (even though you can), but more so, it was reference documentation for how to use New-SNOWIncident (under the hood it's the same thing). New-SNOWIncident just has specific parameters and certain intellisense that New-SNOWObject wont have.
Either way, you can use either function, and the method to update custom fields is exactly the same. You'll need to use the -Properties parameter with the fields you wish to update.
For example -Properties @{customfield1 = "value1"}
Hope this clears up the confusion!
ok thanks i'll go deeper into New-SNOWIncident and i'll rewrite my test code before going into production.
Thanks a lot for the big help!!
Could you help me to use New-SNOWIncident with some custom fields, see attachments
How I can fill the catalog item and the ICT Operation Service?
After successfull auth i tried the a New-SNOWIncident with no luck