Before using this snippet, verify you've met with the following requirements:
- User defined variables:
serviceNowBaseUrl
,serviceNowUserName
andserviceNowPassword
created in your HelloID portal.
This code snippet executes the following tasks:
- Define a hash table
$formObject
. The keys of the hash table represent the properties to create an incident, while the values represent the values entered in the form. See the ServiceNow API documentation
To view an example of the form output, please refer to the JSON code pasted below.
{
"UserIdentity": "johndoe",
"urgency": "1",
"description": "Example inident",
"short_description": "Example"
}
❗ It is important to note that the names of your form fields might differ. Ensure that the
$formObject
hashtable is appropriately adjusted to match your form fields.
- Verify that a
sys_user
withcaller_id
johndoe exists. - If the caller exist, create an incident.