diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index 5e27d7db764d..59a84182b803 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -648,6 +648,11 @@ function getTaskAssigneeAccountID(taskReport) { const reportAction = ReportActionsUtils.getParentReportAction(taskReport); const childManagerEmail = lodashGet(reportAction, 'childManagerEmail', ''); + + if (!childManagerEmail) { + return null; + } + return PersonalDetailsUtils.getAccountIDsByLogins([childManagerEmail])[0]; } diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js index 90d635e43ae9..127592601aec 100644 --- a/src/pages/tasks/NewTaskPage.js +++ b/src/pages/tasks/NewTaskPage.js @@ -86,12 +86,6 @@ function NewTaskPage(props) { setAssignee(displayDetails); } - // If we don't have an assignee and we are creating a task from a report - // this allows us to auto assign a participant of the report. - if (!props.task.assignee && props.task.parentReportID) { - TaskUtils.setAssigneeValueWithParentReportID(props.task.parentReportID); - } - // We only set the parentReportID if we are creating a task from a report // this allows us to go ahead and set that report as the share destination // and disable the share destination selector