ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Workflow.Models.JobModels Namespace / Job Class / CanUserAssignJob Method
The user to test for the ability to assign the job
Example Version

CanUserAssignJob Method
Determines whether the job can be assigned to the specified user
Syntax
public bool CanUserAssignJob( 
   UserDetails currentUser
)

Parameters

currentUser
The user to test for the ability to assign the job

Return Value

Whether the job can be assigned
Remarks
Job can be assigned if, it isn't closed, or on hold and the user has the AssignAnyJob privilege. If the user only has the GroupJobAssign or IndividualJobAssign privileges the job is assignable only if it is assigned to the current user, assigned to any group of the current user or assigned to any user within any group of the current user (only for GroupJobAssign). If the job is on hold the user will also require the CanUpdatePropsforHeldJobs privilege.
Example
UserDetails user = WorkflowModule.GetUser();
Job job = await jobManager.GetJob(jobID);
bool canAssign = job.CanUserAssignJob(user);
if (canAssign)
{
    job.AssignedTo = "newUsername";
    await job.Save();
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also