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

Abdul Azeem
Tera Contributor

Hi @Saranya K ,

 

You can write below code in BR and set up it using the SS below

AbdulAzeem_0-1733237827795.png

BR code - 

(function executeRule(current, previous /*null when async*/) {
	
    if(gs.getUser().isMemberOf(current.assignment_group) || current.assigned_to == gs.getUserID()){
		// gs.addInfoMessage("Change task closed successfully.");
		
	}else{
		
		gs.addErrorMessage("You're not assigned to the task OR neither you're member of current assignment group.");
		current.setAbortAction(true);
	}

})(current, previous);

 OR

You can do the same in ACL as well using same script just return the true or false based on conditions.