How to set Contact Type to Self-Service when Ticket Submitted in Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 09:06 AM
I would like to use the contact type field to track when tickets are submitted in the portal. Is there any easy way to set the contact type to a particular value such as 'self service' when it comes through in the portal?
I have read existing posts which discuss doing it in the record producer script, but what if I am not using a record producer but instead just using the 'form' page/widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 09:30 AM
Hi,
First i would see if i can set the contact type on creation of the record from the widget itself.
Because you would be using the out of the box scripted rest api to create the item and you should be able to set it via the widget itself.
As an alternative,
I would use something like the way Track approval source Business rule works on Approval table.
So i would create the following script in my widget before the creation of the request
var controller = new GlideController();
controller.putGlobal("contact_type", "self-service");
After creation of the request please clear the global value
controller.removeGlobal("contact_type");
In my sc_Req_item, i will have a business rule on insert which will check for contact_type and update it on the record
var controller = new GlideController();
var contact_type = controller.getGlobal("contact_type");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2020 08:39 AM
Hi Venkatiyer,
Can you elaborate more, please. Should this be scripted in the widget - 'SC Catalog Item' or something else.?
Regards
S Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 09:44 AM
Hi Chris
Do you force a view on the users when providing a link to the form page e.g. https://yourinstance.service-now.com/sp?id=form&table=incident&sys_id=-1&view=portal ?
If so, then I was able to get this functionality by creating an onSubmit Client Script with the below configuration:
Hope it helps.
Matt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 10:39 AM
Do I need to add Contact Type to the form for that to work? I was hoping not to expose that field on the form.