Lock down change states for users with change_management role

ebaileyybs
Tera Expert

Hi,

I am looking to lock down certain states available for selection within the change state field. Please see below options;

find_real_file.png

I would like for 'ITIL' users to only be able to select the following states;

Draft

Review

Closed

Users with the change_management role should be able to select any of the above states.

Any help with this would be greatly appreciate.d

Kind regards,

Emma

35 REPLIES 35

Hi,



Our change type does not default to 'Normal' it is set based on the category and change model, therefore if I refresh the screen it set the type back to none.



Based on this I am assuming the user will have to save the change as Normal before the script runs?



Kind regards,


Emma


copy the code in onchange of the type field and check.....


Got it,



SO what you can do is...create another onchange client script , if not already existing, and add this


ONCHANGE OR TYPE.



if(!isLoading)


{


if(newValue=='normal')   //adding condition for type


{


if(g_user.hasRole('itil') && !(g_user.hasRole('change_management')))


{//add all states that you want to remove


g_form.removeOption('state','approved')


g_form.removeOption('state','schedules')


//Others


}


}


else if(gnewValue!='normal')  


{


g_form.clearOptions('state');


g_form.addOption('state','approved','Approved');


//Add all options


}


}



//this else block is important if the user changes the type to any other value after changing to Normanl and then again chanmges to something else


-Anurag

Typos




else if(newValue!='normal')


-Anurag

Hi Anurag Tripathi,Kalaiarasan P ,



                  Instead of adding options and removing options cant we make read only those options? Which one is best way?



Regards,


Harish.