You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a ticket it seems the fields "Extent" and "Severity" are required, however the PS module seems to see them as invalid. Tried both via the New-FreshServiceTicket command below and via POST method shown below
Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "severity",
"message": "It should be one of these values: \u0027Work is not impaired,Work is impaired,Work is stopped\u0027",
"code": "missing_field"
},
{
"field": "extent",
"message": "It should be one of these values: \u0027A single individual,An entire workgroup,An entire department\u0027",
"code": "missing_field"
}
]
}
############. If I do this with those fields specified, I get the below, otherwise I get the above
Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "extent",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
},
{
"field": "severity",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
}
]
}
ModuleType Version PreRelease Name
Script 0.1.6 FreshservicePS
The text was updated successfully, but these errors were encountered:
On Wed, Apr 3, 2024, 16:56 ArroyoINEOS ***@***.***> wrote:
When creating a ticket it seems the fields "Extent" and "Severity" are
required, however the PS module seems to see them as invalid
Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "extent",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
},
{
"field": "severity",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
}
]
}
ModuleType Version PreRelease Name
------------------------------
Script 0.1.6 FreshservicePS
—
Reply to this email directly, view it on GitHub
<#19>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESM4JYE2IAD6LVAAE2LXTDY3RUJJAVCNFSM6AAAAABFWBVAS6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDGOJRGEYDCOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
When creating a ticket it seems the fields "Extent" and "Severity" are required, however the PS module seems to see them as invalid. Tried both via the New-FreshServiceTicket command below and via POST method shown below
$APIKey = "xxxxxxxx"
$EncodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $APIKey,$null)))
$HTTPHeaders = @{}
$HTTPHeaders.Add('Authorization', ("Basic {0}" -f $EncodedCredentials))
$HTTPHeaders.Add('Content-Type', 'application/json')
$URL = "https://xxxxxdomain.freshservice.com/api/v2/tickets"
$Attributes = @{}
$Attributes.Add('requester_id',xxxxxxxxx)
$Attributes.Add('subject',"Test subject")
$Attributes.Add('description',"Test description")
$Attributes.Add('group_id',xxxxxxxxxx)
$Attributes.Add('source',2)
$Attributes.Add('priority',2)
$Attributes.Add('status',2)
$Attributes.Add('severity',"Work is stopped")
$Attributes.Add('extent',"A single individual")
$JSON = $Attributes | ConvertTo-Json
$JSON
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $URL -Headers $HTTPHeaders -Body $JSON -Method Post
Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "severity",
"message": "It should be one of these values: \u0027Work is not impaired,Work is impaired,Work is stopped\u0027",
"code": "missing_field"
},
{
"field": "extent",
"message": "It should be one of these values: \u0027A single individual,An entire workgroup,An entire department\u0027",
"code": "missing_field"
}
]
}
############. If I do this with those fields specified, I get the below, otherwise I get the above
Invoke-WebRequest:
{
"description": "Validation failed",
"errors": [
{
"field": "extent",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
},
{
"field": "severity",
"message": "Unexpected/invalid field in request",
"code": "invalid_field"
}
]
}
ModuleType Version PreRelease Name
Script 0.1.6 FreshservicePS
The text was updated successfully, but these errors were encountered: