servicenow

Tip: Create Scripted REST API in servicenow and consume it in PowerShell

Posted on

In this blog post let me walk through the simple steps to create a “Scripted REST API” which simply prints the hardcoded values. This is a beginners guide so let’s keep things easier! Navigate here to get some more information. { “Name”: “Chendrayan Venkatesan (Chen V)”, “Role”: “ITPro”, “Department”: “Information Technology”, “Skills”: [ “PowerShell”, “REST”, “servicenow”, […]

Windows PowerShell

TIP: Query servicenow Incident record using PowerShell and REST API

Posted on

In order to query the servicenow incident records and to list out the required fields use the sysparm_fields column which helps in optimization. Now,  See the code, result and performance All Fields function Get-ServiceNowIncident { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] $IncidentID, [Parameter(Mandatory)] [pscredential] $Credential ) try { $Uri = “https://dev42835.service-now.com/api/now/table/incident?sysparm_query=number=$($IncidentID)” $Result = Invoke-RestMethod -Uri […]