Skip to content

Commit 51ef241

Browse files
authored
Merge pull request #56 from n3rden/patch-2
Adding comment based help to function New-ServiceNowIncident
2 parents 227fba7 + 72d1b14 commit 51ef241

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

ServiceNow/Public/New-ServiceNowIncident.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
function New-ServiceNowIncident{
2+
<#
3+
.SYNOPSIS
4+
Generates a new ServiceNow Incident
5+
6+
.DESCRIPTION
7+
Generates a new ServiceNow Incident using predefined or custom fields by invoking the ServiceNow API
8+
9+
.LINK
10+
https://github.com/Sam-Martin/servicenow-powershell
11+
12+
.EXAMPLE
13+
Generate a basic Incident attributed to the caller "UserName" with descriptions, categories, assignment groups and CMDB items set.
14+
New-ServiceNowIncident -Caller "UserName" -ShortDescription = "New PS Incident" -Description = "This incident was created from Powershell" -AssignmentGroup "ServiceDesk" -Comment "Inline Comment" -Category "Office" -Subcategory "Outlook" -ConfigurationItem UserPC1
15+
16+
.EXAMPLE
17+
Generate an Incident by "Splatting" all fields used in the 1st example plus some additional custom ServiceNow fields (These must exist in your ServiceNow Instance):
18+
19+
$IncidentParams = @{Caller = "UserName"
20+
ShortDescription = "New PS Incident"
21+
Description = "This incident was created from Powershell"
22+
AssignmentGroup "ServiceDesk"
23+
Comment "Inline Comment"
24+
Category "Office"
25+
Subcategory "Outlook"
26+
ConfigurationItem UserPC1
27+
CustomFields = @{u_custom1 = "Custom Field Entry"
28+
u_another_custom = "Related Test"}
29+
}
30+
New-ServiceNowIncident @Params
31+
32+
#>
33+
234
Param(
335

436
# sys_id of the caller of the incident (user Get-ServiceNowUser to retrieve this)

0 commit comments

Comments
 (0)