Change Task should be closed only by Assigned to person?

Saranya K
Tera Contributor

Hi all,

 

The change Task should be closed only by Assigned to person and the member of the assignment group even admin should not closed the task.

 

How we can achieve this through acl or Business rule 

Thanks,

15 REPLIES 15

Harsh_Deep
Giga Sage
Giga Sage

Hello @Saranya K 

 

You can use before BR, on the change_task table, there you can right.
if(!current.assignment_group){

current.setAbortAction(true);

}

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

Hi @Harsh_Deep ,

 

I need to check the user who is closing the task is assigned to person or member of the assignment group in change task even admin should not able to close the task .

 

Below code is not working

Hello @Saranya K 

 

Then also same br but just change if condition-

    if(!gs.getUser().isMemberOf(current.assignment_group)){
        current.setAbortAction(true);
    }
 
Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

Vinuthna Ammana
Mega Guru

Hi, we can achieve using ACL too, if you are using Xanadu, try deny unless acl 

VinuthnaAmmana_0-1733207632450.png

Make sure to untick 'admin overrides' checkbox and in script
add script condition

 

if (current.getValue("assigned_to") == userId ||gs.getUser().isMemberOf(current.assignment_group)){
    answer = true;
}

 

we want to not allow admin only to close the task, please change the applies to condition as you require.
You may need to update the UI action 'close task' also accordingly

 

(gs.getUser()==current.assigned_to  ||gs.getUser().isMemberOf(current.assignment_group))

 

Add this condition to the UI action 'close task' on the table 'change_task'

Regards,
Vinuthna