Since TaskRay is a 100% Salesforce native application, the Lightning Process Builder can be used to automate various TaskRay processes.
In this article we will be leveraging the "Clone a TaskRay Task" apex process builder action. This process builder action can be used to clone an individual TaskRay Task and insert it into an existing TaskRay Project.
In this article, we will configure process builder to insert a template task into a Bug project when a new Case is created in Salesforce with a status of Escalated.
As you go through these instructions, keep in mind that there are many other possibilities for customizing the process and you can modify the setup to suit the specific needs of your organization.
Other examples of TaskRay + Process Builder:
Step 1: Set Everything Up in TaskRay
Create Templates
The first step of the process is to make sure that you have the necessary template task created in TaskRay. A task is considered to be a template task when it is part of a template project in TaskRay. You can learn more about creating templates here.
For this example, we have created a task named "Bug" that is set up to track all necessary information for bugs.
- Open Task Details of the template Bug task.
- Click on the Task Name in the Task Details window header.
- This will take you to the standard Salesforce interface for the Task record. In the browser address bar highlight and copy the record ID. You will need this record ID later in the process.
Create an Escalated Case Inbox Project
For this example, we've created an Escalated Case Inbox project in TaskRay to keep track of all reported Cases with Status set to Escalated (eventually TaskRay Tasks that will be created from Cases). You can add a specific project team to this project that would be in charge of working on the reported bugs. For this purpose, create a new project with the name "Escalated Case Inbox". Please see Create Projects for more information.
- Open Project Details of the Escalated Case Inbox project.
- Click on the Project Name in the Project Details window header.
- This will take you to the standard Salesforce interface for the Task record. In the browser address bar highlight and copy the record ID. You will need this record ID later in the process.
Step 2: Build the Process using the Process Builder
Now that TaskRay is all set up and you have the template task created, the next step is to build the actual automated process.
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, API Name, and Description.
- For The process starts when field, select A record changes.
- Click Save.
Select the Object for the Process
The first thing that you need to do is select the object that will trigger the automated process. In this case, we will select the Case object, because that is where the initial action will take place.
- On the canvas, click on + Add Object.
- For the Object field, select Case.
- 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 process. In our example, it would be the act of creating a Case record with a Status set to Escalated.
- On the canvas, click on + Add Criteria.
- Enter the Criteria Name.
- Under Criteria for Executing Actions, select Conditions are met.
- Under Set Conditions, select the following:
- Field = [Case].Status
- Operator = Equals
- Type = Picklist
- Value = Escalated
- Under Conditions, select All of the conditions are met (AND).
- Click on Advanced to expand additional settings and select the Yes checkbox.
- This means that we want to execute this action only when the specified changes are made to the record. In our case, we want the action to fire only when the Priority is changed to High.
- 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 fired. In our example, the action that should occur when the process is fired is the creation of a new TaskRay Task in the Escalated Case Inbox TaskRay Project.
- On the canvas under Immediate Actions, click on + Add Action.
- For Action Type, select Apex.
- Enter the Action Name.
- For Apex Class, select Clone a TaskRay Task.
- Under Set Apex Variables, click on + Add Row and select the following:
- Field = Template Task Id
- Type = Id
- Value =< enter the ID of the Existing Escalated Case Template task you found earlier >
- Click on + Add Row and select the following:
- Field = Owner for Task
- Type = Reference
- Value = [Case].Owner ID
- Click on + Add Row and select the following:
- Field = Project for Task
- Type = Id
- Value =< enter the ID of the Escalated Case Inbox Project you found earlier >
Tip: This row specifies what project the cloned template task will be added to.
- Click on + Add Row and select the following:
- Field = Source Object Id (populates lookup fields for task)
- Type = Reference
- Value =[Case].Case Id
Tip: This row will populate any Case lookups you may have made on the TaskRay Task object with the case that triggered this process builder.
- Click on + Add Row and select the following:
- Field = Task Name
- Type = Reference
- Value =[Case].CaseNumber
Tip: This row will set the Task Name on the newly created task. Feel free to use formulas here to get creative in the naming, just remember Task Names cannot be more than 80 characters.
- Click Save.
- Click Activate in the top right corner.
Step 3: Test It Out!
It's time to see how all of this works together. Create a new Case record with a Status set to Escalated. You should see a new task added to the Escalated Case Inbox project!