I want want to make assigned to as mandatory on the incident form?

Ramu6
Tera Contributor

Hi All, 

We have a requirement that 

              When we  update the Incident State to Active and the Assignment group remains unchanged then we need to Assigned To field is made Mandatory

 

Please help to proceed on this

 

Thanks

Ramu

11 REPLIES 11

amitshishod
Tera Guru

Hello @Ramu6 , you can try using UI Policy or client script. (Please confirm me complete scenario as incident is being or active here or state is changing to a new state and do you want to reverse the situation or not).

I hope that it will help you. 
 If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Hi @amitshishod 

My requirement like when state is update to "active " and assignment group remains no change(no update in the assignment group that means if assignment group has some have value, we it should remains same only), then we need to make assigned to as mandatory

 

Thanks

AndersBGS
Tera Patron
Tera Patron

Hi @Ramu6 ,

 

This can easily be done by a UI policy where you state the IF conditions then assigned to is mandatory. 

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Rajesh Chopade1
Mega Sage

hi @Ramu6 

You can use the client-side script to check the State and Assignment Group. If the conditions are met, we will set the Assigned To field to mandatory.

UI Script (client side):

// This script will run when the user clicks the UI Action button
function onClick() {
    var state = g_form.getValue('state'); // Get the current state of the Incident
    var assignmentGroupChanged = g_form.getValue('assignment_group') !== g_form.getOriginalValue('assignment_group'); // Check if Assignment Group has changed

    // Check if state is 'Active' and Assignment Group remains unchanged
    if (state == 'Active' && !assignmentGroupChanged) {
        // Make the Assigned To field mandatory
        g_form.setMandatory('assigned_to', true);
        // Optionally, show a message to the user
        g_form.showFieldMsg('assigned_to', 'Assigned To is mandatory when State is Active and Assignment Group remains unchanged.', 'info');
    } else {
        // If the conditions are not met, ensure Assigned To is not mandatory (optional)
        g_form.setMandatory('assigned_to', false);
        g_form.hideFieldMsg('assigned_to');  // Hide the message if it's no longer needed
    }
}

 

I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

Rajesh

hi @Rajesh Chopade1 

is this a client script?