SalesforceLabs / ActionPlansV4

Action Plans encapsulates best practices into reusable task templates.
https://salesforcelabs.github.io/ActionPlansV4/
BSD 3-Clause "New" or "Revised" License
21 stars 11 forks source link

Tasks Created from different Action Plan #165

Open adepew opened 10 months ago

adepew commented 10 months ago

Describe the bug Occasionally I have users tell me they have been assigned tasks from another user on the team and before their controlling tasks have been completed. This occurs when the first user is working with their own tasks and closing tasks. I have a feeling this is related to the action plan templates feature and the task dependencies. It seems like it is selecting controlling tasks that are not related to the action plan the user is working on. I have attached some screenshots below.

Screenshots As you can see below, the action plan has 0 completed tasks. However, the 3 tasks with controlling tasks have been created, all by the 1st user that was working on their own task lists. image

Here is the task the first user marked completed which triggers the next task "Check-in call". It was closed on 11/2/2023 at 10:21AM. image

This task is the one that was created by the prior user and was created at the exact same time as their prior task was closed: image

Additional context I haven't been able to run any advanced debugging logs yet to try and pinpoint the issue exactly, but this is defintely happening for multiple users and action plans. It seems to be an issue with the code that creates an action plan task when dependent tasks are marked completed.

adepew commented 8 months ago

Apologies for the delay, I was out on paternity leave. I think I may have found the reason why some closed tasks are creating tasks for other Accounts.

If I query the LabsActionPlansAPTaskc object I am seeing some inconsistencies. In the LabsActionPlans__Action_Planc field I see the correct Id for the Action Plan. However, in the LabsActionPlansController__c field I see Ids that are related to other Action Plans that are not for the current Action Plan. It seems this field is used for dependent tasks that need to be created so that aligns with what I am seeing. See below:

image