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

JenniferRah
Mega Sage

Why not just use a Catalog UI Policy to hide all the variables after it's closed? 

 

If you really need to set all the variables to asterisks (which isn't really feasible unless all your variables are strings), you can do it via a Business Rule or even a scripted UI Policy, but it would be pretty messy.

Ideally  - I would like to try to find working method to obfuscate variables in the variable editor, so this will also be updated on any catalogue tasks linked to the ritm - all the variables would be strings in regards to the catalogue item that creates the request. 

This script will go through all variables and set ones that are not empty to asterisks.

for (var key in current.variables) {
    var v = current.variables[key];
    question = v.getGlideObject().getQuestion();
    if (question) { //needed in case any variables are variable sets
        value = v.getDisplayValue();
        if (value != '') {
            current.variable_pool[key] = '****';
        }
    }
}

V V Satyanaraya
Tera Contributor

Hi @AndrewWrigh ,

 

since the information is present on the RITM variable editor section, create a UI policy or client script which hides the variable editor information when the RITM state changes to closed.

 

use below script to hide the specified variables 

if(state=="closed"){

g_form.setVisible('variables.field name'v,false);

//g_form.setVisible('variables.short_description', false);

}

If my response helped please mark it helpful