If you would like TaskRay to automatically send out notifications to task owners when dependent predecessor tasks are completed, you can do so using the Process Builder. This automation will help your users easily stay up to date on their projects and quickly see the tasks that are ready to be worked on.
This article walks through all of the steps for sending task owners notifications when all dependent predecessor tasks are completed. At a high level, the steps are:
- Make sure all of the necessary task dependencies are in place.
- Create an email template and workflow rule that will get sent to the task owner when the dependent predecessors are finished.
- Set up a process to send out the email notification to the task owner.
Step 1: Set Up Dependencies
In order for the automation to work, it is important that dependencies are enabled and set up correctly between tasks on your projects. You can read more about enabling and setting up dependencies in the Task Dependencies support article.
Step 2: Create Email Template [Admin]
The next step of the process is to create the email template that would be used to notify task owners when preceding tasks are completed.
- From Setup, navigate to:
- Lightning: Email | Email Templates.
- Classic: Communication Templates | Email Templates.
- Click on New Template.
- Step 1: Choose the preferred template type. Select Custom (without using Letterhead). Click Next.
Note: The Custom (without using Letterhead) option allows you to use basic HTML for a more polished look and feel. - Step 2: Select a Folder, check the Available for Use checkbox, enter Email Template Name (i.e. Completed Predecessor Task Notification) and Description. Click Next.
- Step 3: Draft the email. Enter the Subject. For HTML Body, you can use the sample text below. Click Next.
Note: If you use the sample HTML text below, make sure to replace the URL to make it work for your org. Notice that the link in the sample text includes "taskray.na1...". To make the URL work, you must replace the na# to match your production. Look at your web address while in Salesforce and note the first three or four digits (na#). In the sample code below, change na1 to match the number from your own production instance.
Sample HTML Text:<html>
<body style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size:12px;">
<p>Hello {!TASKRAY__Project_Task__c.OwnerFirstName},</p>
<p>Great news! Your task is ready to be started.</p>
<p>Task: <a href="https://taskray.na1.visual.force.com/apex/TASKRAY__trtaskboard?taskid={!TASKRAY__Project_Task__c.Id}" target="_blank">{!TASKRAY__Project_Task__c.Name} </a>
<p>Project: {!TASKRAY__Project_Task__c.TASKRAY__Project__c}</p>
<p>Due Date: {!TASKRAY__Project_Task__c.TASKRAY__Deadline__c}</p>
</body>
</html> - Step 4: Create text-only version. Click on the Copy text from HTML version button to add a plain text version of the notification. In the Warning dialog, click OK. Click Save.
- On this page, review the HTML and the Plain Text message versions. If you would like, you can send a test email by clicking on the Send Test and Verify Merge Fields button.
Step 3: Create Email Alert Workflow Rule [Admin]
Now that you have a notification template, the next step is to create an Email Alert Workflow Rule to specify who the alert should be sent to. In this case, it will be the TaskRay Task Owner of the task that is ready to be worked on.
- From Setup, navigate to:
- Lightning: Process Automation | Workflow Actions | Email Alerts.
- Classic: Create | Workflow & Approvals | Email Alerts.
- Click on New Email Alert.
- Enter a Description (i.e. "Notify Dependent Task Owner When Predecessor Task Is Completed"). The Unique Name field should populate automatically.
- For Object, select TaskRay Task.
- For Email Template, click on the lookup icon and select the Completed Predecessor Task Notification template that you created previously (from the section above).
- Select Recipient Type. For Search, select Owner. This will filter the list of Available Recipients below. From the list, select TaskRay Task Owner and move it to the Selected Recipients section using the Add button.
- Click Save.
Step 4: Set Up the Process to Send the Notification Email [Admin]
Next, you will need to build a process that would send the notification email to the task owner that his/her task is ready to be worked on.
Create a New Process
- From Setup, navigate to:
- Lightning: Process Automation | Process Builder.
- Classic: Create | Workflow & Approvals | Process Builder.
- Click New.
- Enter the Process Name (i.e. "Send Email Notification to Task Owner When Predecessor Task Is Finished"), API Name, and Description.
- For The process starts when field, select A record changes.
- Click Save.
Select the Object for the Process
The first step is to select the object that will trigger the automated process. In this case, we will select the TaskRay Task object, because that is where the initial action will take place.
- On the canvas, click on + Add Object.
- For the Object field, select TaskRay Task.
- Under Start the process, select When a record is created or edited.
- Click Save.
Define the Criteria That Triggers the Process
The next part of building the process is to define the criteria that will trigger the notification. In this case, we will want the notification to be sent once a task has of all of its dependent predecessor tasks complete.
- On the canvas, click on + Add Criteria.
- Enter the Criteria Name (i.e. "Task is Ready for Work").
- Under Criteria for Executing Actions, select Formula Evaluates To Be True
- Under Formula, enter the following:
- AND(
[TASKRAY__Project_Task__c].TASKRAY__trPredecessorTasksIncomplete__c = FALSE,
PRIORVALUE([TASKRAY__Project_Task__c].TASKRAY__trPredecessorTasksIncomplete__c) = TRUE
) - Click Save.
Define the Actions That Occur When the Process Runs
Next, you need to define the actions that should occur when the process is triggered (in this case, all predecessor tasks are completed). Here, the action that should occur when the process is fired is sending out the email notification that was created earlier.
- On the canvas under Immediate Actions, click on + Add Action.
- For Action Type, select Email Alerts.
- Enter the Action Name (i.e. "Send email alert to task owner").
- Click into the Email Alert field and search for the email template that you created earlier ("Notify Dependent Task Owner When Predecessor Task Is Completed").
- Click Save.
Activate the Process
- Click Activate.
- In the dialog, click Confirm.
Try It Out!
That's it! Now, every time a task is completed in TaskRay, the owner of the next dependent task will get an email notification to begin work.