Checking if a user is an Agent

This script can be used to check if user is a JSM Agent, this would then allow to determine whether to add the request participant or add the user to a JSM Agent role first.

 

#set($jsdApiUtils = $jemhUtils.getJsdApiUtils()) #set($project = $projectManager.getProjectByCurrentKey('TASK')) #set($user = $jemhUtils.getUserByEmail('admin@localhost')) #if($jsdApiUtils.isAgentForProject($project, $user)) Yes #else No #end