caller is referred to user and category is choice list in incident with using of reference qualifier

SNow Learner41
Tera Contributor

Hi Guys,

caller is referred to user and category is choice list in incident with using of reference qualifier need to do filtering i am unable to understand can any one please make me understand and how to solve this task.Screenshot 2024-01-25 063805.pngWhen, i am selecting any one category then those users only shown in caller.

 

Thank You in advance,

Kiran Kumar.   

5 REPLIES 5

Aniket Chavan
Tera Sage
Tera Sage

Hello @SNow Learner41 ,

Could you kindly confirm if my understanding is accurate? It seems that you aim to set the "caller" field value based on the selected category. If this is the case, you can create an onChange client script. Assuming you have predetermined the users' sys_id values for each category, you can use these sys_id values to dynamically set the "caller" field based on the selected category.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    // Assuming 'current' is the incident record
    var selectedCategory = g_form.getValue('category');

    // Define a mapping of categories to corresponding caller users
    var categoryCallerMap = {
        'ServiceNow X': 'sys_id_of_user_for_servicenow_x',
        'Inquiry/Help': 'sys_id_of_user_for_inquiry_help',
        // Add more categories and user sys_ids as needed
    };

    // Get the sys_id of the caller based on the selected category
    var callerSysId = categoryCallerMap[selectedCategory];

    // Set the value of the "caller" field
    g_form.setValue('caller', callerSysId);
}

 

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Aniket

Thank you @Aniket Chavan for your response,

my task need to complete using reference qualifier only.

when category is selected then according to category users list should display in caller field.

Example: if we select software category, then only software related users should display in caller field.

Vishal Birajdar
Giga Sage

Hi @SNow Learner41 

 

Can you please provide some more information on this...!!!

Not sure if i'm correct , when category is selected then according to category users list should display in caller field...??

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Thank you for your response @Vishal Birajdar 

Yes exactly your understanding is correct.

Example: if we select category is software, then only software related users will be display in caller field and my requirement is todo using with reference qualifiers.