Remove change task record delete functionality for everyone when associated change is in state close

JohnDF
Mega Sage

Hi everyone,

 

I try to remove the change task record delete functionality for everyone when associated change is in state close. Even admin should not be possible to delete change task whn the parent change is in state closed.

 

I tryed a acl but this remove the delete record function totaly and not only when parent cange is closed. What could b the problem here?

 

JohnDF_0-1667903507433.png

 

Thanks for your help.

1 ACCEPTED SOLUTION

@JohnDF ,

 

Yes, you need to select a role, you should put there role(s) who should be able to delete when Change Requestis Not Closed. Don't take it as the role mentioned there will be able to delete anytime. Keep itil_admin role there. Just put the condition in condition builder as shown below and it will work for the condition you mention to work.

 

kamleshkjmar_0-1667917825527.png

 

Give it a shot and let me know if it fails in your testing.

 

Regards,

Kamlesh

 

 

 

View solution in original post

6 REPLIES 6

kamlesh kjmar
Mega Sage
Mega Sage

Hi @JohnDF ,

 

g_form is a client side object hence do not work at server side. Try the below code :

 

if(current.change_request.state == "3")
answer = "false"
else
answer = "true"

I hope this help.

 

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

 

Regards,

Kamlesh

 

@JohnDF ,

 

Infact no need to use script, your condition builder is sufficient for this, do a dot walk to change_request.state, put your condition in condition builder like shown below and it should work

 

kamleshkjmar_1-1667906126694.png

 

 

 

I hope this help.

 

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

 

Regards,

Kamlesh

Please read right. Wit your condition the itil_admin can delte change task. I want that no one event nit admin schould be possible to delte change task. Thats why I ue the script part. But its not working.

@JohnDF ,

 

Sorry, that came inside the screenshot and I thought you will ignore it. Anyways please concentrate on the condition builder only. Role you can adjust as per your need, if you don't want the role delete it.

 

Also just to let you know, no matter what role is there, if your condition builder evaluate to false, no one will be able to delete the record. For an ACL to allow operation, all conditions must be met i.e. role,condition and script together.

 

I hope this helps.

 

Regards,

Kamlesh