Change Task creation for specific role in specific change state

JohnDF
Mega Sage

Hi everyone,

 

I have a requirement that only change_manager role from the change state "scheduled" are allowed to create change_task for normal changes.

 

I considered about a ACL restriction. But its still not working. ITIL users can still create change task from the related list of a change request in state "scheduled"

 

Any suggestion how I achive my requirement?

 

JohnDF_0-1666690628225.png

Thanks for your help.

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

You do not have to do anything to the ACL. Just do the below:-

 

Right click on the column of the Change task related list in Change request then configure-> list control as below:-

 

Saurav11_0-1666692881500.png

 

Then once it opens in the omit new condition field write the below script:-

 

answer=false;
if(change_request.type=='normal')
{
if((change_request.state==-2 ||change_request.state==-1||change_request.state==0||change_request.state==3||change_request.state==4) &&gs.getUser().hasRole('change_manager'))
{
answer = false;
}
else if (change_request.state==-5 ||change_request.state==-4 ||change_request.state==-3)
{
answer = false;
}
else
{
	answer=true;
}
}

 

Saurav11_1-1666692961303.png

 

Please mark my answer as correct based on Impact.

View solution in original post

4 REPLIES 4

kamlesh kjmar
Mega Sage
Mega Sage

Hi @JohnDF ,

 

As per ACL execution rule if there exists even one ACL that gives the permission then the operation will be allowed.

I am sure this is the same case that's working in your scenario. Please check all ACL(s)  for operation create that are written on change_task table and check if that is giving write access to itil. OOB itil users are allowed to do that. You can deactivate those create ACLs on change_task if not needed. Then your acl will definitely work.

 

kamlesh8_0-1666691680739.png

I Hope this helps.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

You do not have to do anything to the ACL. Just do the below:-

 

Right click on the column of the Change task related list in Change request then configure-> list control as below:-

 

Saurav11_0-1666692881500.png

 

Then once it opens in the omit new condition field write the below script:-

 

answer=false;
if(change_request.type=='normal')
{
if((change_request.state==-2 ||change_request.state==-1||change_request.state==0||change_request.state==3||change_request.state==4) &&gs.getUser().hasRole('change_manager'))
{
answer = false;
}
else if (change_request.state==-5 ||change_request.state==-4 ||change_request.state==-3)
{
answer = false;
}
else
{
	answer=true;
}
}

 

Saurav11_1-1666692961303.png

 

Please mark my answer as correct based on Impact.

@Saurav11 thanks for reply.

That is interessting. But I entered it like you and the itil user can still create change task in all change states. They should only allowed to create change task for the states new, asses and authorize. From schedule state its only allowed for change_managers.

 

JohnDF_0-1666707304357.png

 

Hello,

 

You are using the wrong field for the script. You are using Omit edit condition but you need to use omit new condition as below:-

 

Saurav11_0-1666707778714.png

 

If you don't see that field on the form just configure-> form layout and bring that field on the form and write the script.

 

Please mark my answer as correct based on Impact.