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 06:14 AM
Hi,
How would I set this so it shows state for change_management users? These users will also have the ITIL role.
Kind regards,
Emma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:23 AM
if(g_user.hasRole('itil') && !(g_user.hasRole('change_management')))
{
g_form.removeOption('state','approved')
g_form.removeOption('state','schedules')
//Others
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:25 AM
Would this work for both scenarios?
1) User with ITIL licenese should only see states 1, 2 &3
2) User with change_management role should see all states
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:27 AM
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
}
This code will work in this way
1) all users who have ITIL but not change_management role will see only states 1, 2 &3
2) All users with change_management role, regardless whether they have ITIL or not, will see all states
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2015 06:36 AM
Thank you, this works really well.
I would like this to only apply if the type of the change = Normal. How would i add this to the script please?