Skip to content

Commit aed3890

Browse files
committed
base new ci params
1 parent 2b497a1 commit aed3890

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

ServiceNow/Public/New-ServiceNowConfigurationItem.ps1

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,41 @@ Generates a new configuration item
55
.DESCRIPTION
66
Generates a new ServiceNow Incident using predefined or custom fields by invoking the ServiceNow API
77
8+
.PARAMETER Name
9+
Name of the ci
10+
811
.EXAMPLE
912
Generate a basic Incident attributed to the caller "UserName" with descriptions, categories, assignment groups and CMDB items set.
1013
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
1114
1215
.EXAMPLE
13-
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):
14-
15-
$IncidentParams = @{Caller = "UserName"
16-
ShortDescription = "New PS Incident"
17-
Description = "This incident was created from Powershell"
18-
AssignmentGroup "ServiceDesk"
19-
Comment "Inline Comment"
20-
Category "Office"
21-
Subcategory "Outlook"
22-
ConfigurationItem UserPC1
23-
CustomFields = @{u_custom1 = "Custom Field Entry"
24-
u_another_custom = "Related Test"}
25-
}
26-
New-ServiceNowIncident @Params
27-
2816
#>
2917
function New-ServiceNowConfigurationItem {
3018

3119
[CmdletBinding(DefaultParameterSetName = 'Session', SupportsShouldProcess)]
3220

3321
Param(
3422

35-
# sys_id of the caller of the incident (user Get-ServiceNowUser to retrieve this)
3623
[parameter(Mandatory)]
3724
[string] $Name,
3825

39-
# Short description of the incident
4026
[parameter(Mandatory)]
41-
[string] $ShortDescription,
27+
[string] $Class,
4228

43-
# Long description of the incident
4429
[parameter()]
4530
[string] $Description,
4631

47-
# sys_id of the assignment group (use Get-ServiceNowUserGroup to retrieve this)
48-
[parameter()]
49-
[string] $AssignmentGroup,
50-
51-
# Comment to include in the ticket
5232
[parameter()]
53-
[string] $Comment,
33+
[string] $OperationalStatus,
5434

55-
# Category of the incident (e.g. 'Network')
5635
[parameter()]
57-
[string] $Category,
36+
[string] $Environment,
5837

59-
# Subcategory of the incident (e.g. 'Network')
6038
[parameter()]
61-
[string] $Subcategory,
39+
[string] $FQDN,
6240

63-
# sys_id of the configuration item of the incident
6441
[parameter()]
65-
[string] $ConfigurationItem,
42+
[ipaddress] $IpAddress,
6643

6744
# custom fields as hashtable
6845
[parameter()]

0 commit comments

Comments
 (0)