Update variables on RITM went state updated to closed

AndrewWrigh
Tera Expert

Hi all

 

I could do with a some assistance in producing a script,  be it a client or business rule, to update the variables on RITM ticket once the state has been updated to completed. This will be anonymize end user customer data.  So ideally I would envision the process would be for the script look for any RITM record that has a specific short description and a state as closed to update the variables in the editor to a set of asterisk. Thank you.

8 REPLIES 8

Hi @V V Satyanaraya 

 

Thanks for the script, I tried this in my instance but unfortunately it didn't produce the desired results, I'll continue to investigate if there are any conflicting scripts already setup in the environment.  

Ankur Bawiskar
Tera Patron
Tera Patron

@AndrewWrigh 

can you explain why you are not using onLoad client script on RITM and check the state and then make those variables readonly

Something like this

function onLoad() {

    if (g_form.getValue('state') == 3) {
        g_form.setReadonly('variables.variableName', true);
    }
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Setting the variables to read only will only prevent from being altered in the instance rather than anonymising the data which could be deemed sensitive.

@AndrewWrigh 

you can hide those variables if it contains sensitive data

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader