Lock down change states for users with change_management role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 05:07 AM
Hi,
I am looking to lock down certain states available for selection within the change state field. Please see below options;
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 07:03 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 07:07 AM
copy the code in onchange of the type field and check.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 07:15 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 07:17 AM
Typos
else if(newValue!='normal')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 07:21 AM
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.