KACE Product Support Question
Adding an asset entry into a ticket field
We are creating an IT-support ticket for the it dept.
We have a field in the ticket where the user phone
number is required.
We have an asset called (company phones), with the phone
number and the user its assigned to.
Is there a way i can auto-populate the "phone number" field in the
ticket with the "phone number" from the asset....... if the "Ticket Submitter"
and the User in the "company phones" asset are the same?
I pray this makes sense.
Community Chosen Answer
In the Queue configuration's Customize Fields and Layout page choose one of Custom fields that will hold the phone number. Make a note of which field you are choosing, you will need it later.
Set the Field type to Text and the default value to "Set on Save"
Update the label for the custom field in the Layout Ticket Fields section.
Save the queue configuration.
Back on the Queue Detail page scroll down to Custom Ticket Rules and click Customize
Under Choose Action, select New (SQL)
Give your rule a name, something like Set Submitter Phone # Field
Make sure that the Enabled checkbox is checked
For the Select SQL paste the following:
where HD_TICKET.CUSTOM_FIELD_VALUE5 = 'Set on Save'
You will have to adjust the CUSTOM_FIELD_VALUE5 to match the custom field that you chose. The column names in the database start with 0 instead of 1, so custom field 1 is CUSTOM_FIELD_VALUE0 in the database. So take the number of your custom field, subtract one and change the 5 to your number.
Check the box for Run update query.
For the Update SQL paste the following:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE5 = (select WORK_PHONE FROM USER where ID = SUBMITTER_ID) where
T.ID = <TICKET_IDS>;
Again, update the CUSTOM_FIELD_VALUE5 appropriately.
The <TICKET_IDS> that you see is a variable that will be replaced with the ID of the ticket returned by the select statement. We will be setting this rule to run on ticket save so it will only return one ticket. For scheduled rules that will update multiple tickets the variable becomes a list of the ticket IDs.
This rule will also update the ticket with the user's work phone. Other options are HOME_PHONE, MOBILE_PHONE and PAGER_PHONE. If the phone number is being stored in a custom user field, then that's a bit more complicated.
Under the Schedule section select on Ticket Save for frequency.
Optional: Check the box for Append comment to ticket and enter something like "Set submitter's phone to work phone" if you want to track when the rule has updated a ticket and let the technicians know.
Save the rule.