diff --git a/roda-ui/roda-wui/src/main/java/org/roda/wui/api/controllers/JobsHelper.java b/roda-ui/roda-wui/src/main/java/org/roda/wui/api/controllers/JobsHelper.java index 43a540e08d..427ec8ed08 100644 --- a/roda-ui/roda-wui/src/main/java/org/roda/wui/api/controllers/JobsHelper.java +++ b/roda-ui/roda-wui/src/main/java/org/roda/wui/api/controllers/JobsHelper.java @@ -40,6 +40,7 @@ import org.roda.core.data.v2.index.sublist.Sublist; import org.roda.core.data.v2.jobs.IndexedReport; import org.roda.core.data.v2.jobs.Job; +import org.roda.core.data.v2.jobs.JobUserDetails; import org.roda.core.data.v2.jobs.PluginState; import org.roda.core.data.v2.jobs.Reports; import org.roda.core.data.v2.user.User; @@ -71,6 +72,14 @@ protected static void validateAndSetJobInformation(User user, Job job) throws Re job.setName(job.getId()); } job.setUsername(user.getName()); + + // Set the JobUserDetails in Job creation + JobUserDetails jobUserDetails = new JobUserDetails(); + jobUserDetails.setUsername(user.getName()); + jobUserDetails.setEmail(user.getEmail()); + jobUserDetails.setFullname(user.getFullName()); + jobUserDetails.setRole(RodaConstants.PreservationAgentRole.EXECUTING_PROGRAM.toString()); + job.getJobUsersDetails().add(jobUserDetails); } protected static void validateJobInformation(User user, Job job)