Incident caller autopopulate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:33 PM
Hi
Here I want to populate caller field in the owner field(referring to user field same as like caller field) what ever the incident number populating that caller should be populated in the owner field.
I tried reference qualifier in the owner field -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:43 PM
Hi @shivaadapa
Reference qual, only used to filter data from reference table, and provides data to select in reference field as per reference qual.
If you want to autopopulate Owner field, you have to write the onchange client script on Incident field, and call glide ajax function to get incident caller value from server end and then set the value in u_owner field with sys id of the user which you will receive from server through glide ajax function.
I hope, you know the way to use Glide Ajax. if not please visit below URLs:
https://developer.servicenow.com/dev.do#!/reference/api/utah/client/c_GlideAjaxAPI
Let me know if you need any more help with this.
Please mark my answer helpful and correct.
Thank You.
Regards,
Shubham Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:59 PM - edited 04-12-2024 12:09 AM
Hi @shivaadapa ,
You can also achieve this using a Calculated Value. To configure it, right-click on the owner field, select "Configure Dictionary," then go to "Advanced View." Under "Calculated Value Related List," check the "Calculated" box and enter the script in the designated area as per below .
(function calculatedFieldValue(current) {
if(!current.caller_id.nil())
return current.caller_id; // return the calculated value
})(current);
Final Outcome -
In addition to calculated values, you can also use other methods like GlideAjax or the getReference method to auto-populate the Owner field.
GlideAjax -
getReference -
if my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2024 03:41 AM
Hi @shivaadapa,
You can also achieve this using Client Script and Script Include.
Client Script as per below:
Type: on change
Please mark my response as correct and helpful if it helped solved your question.