There might be instances when you might need to assign the same team to different projects. To save you some time, here are a couple of different approaches that you can take to automatically assign a previously built team to new projects.
When you create template projects, you have the option to add a team to the template project and even preassign tasks to those team members. Whenever templates are cloned to create new projects in TaskRay, all of the project details, including the team and predefined task assignments, are cloned as well. You can read more about templates in this article: Create Templates.
If you are creating new projects from scratch rather than cloning templates, you can use the Lightning Process Builder to automatically assign team members to newly created projects.
Find User IDs
First things first, you will need to find the IDs for the users that you want to automatically assign to new projects. You can find user IDs by following the steps outlined in this Salesforce article: Locate a Salesforce User ID. Remember these IDs because they will be used later when building out the process.
Create a New Process
- From Setup, navigate to:
- Lightning: Process Automation | Process Builder.
- Classic: Create | Workflow & Approvals | Process Builder.
Select the Object for the Process
The next step is to select the object that will trigger the process. In this case, we will select the TaskRay Project object, because that is where the initial action will take place.
- On the canvas, click on + Add Object.
- For the Object field, select TaskRay Project.
- Under Start the process, select Only when a record is created.
- Click Save.
Define the Criteria That Triggers the Process
After you select the object, the next part of building the process is to define the criteria that will trigger the process. In this process, this part is optional and will depend on what you want to happen with automatic assignment. In the case that you would like to have the selected users to be automatically assigned to all projects in TaskRay, you would not define any criteria in this step. However, if you would like to only assign the users to specific new projects, you can add as much criteria in this section as necessary (for example, only projects that contain a certain word in the name, projects linked to a specific account, etc.).
For the purpose of this tutorial, we will assume that we want to assign all new projects to our predefined team.
- On the canvas, click on + Add Criteria.
- Enter the Criteria Name.
- Under Criteria for Executing Actions, select No criteria-just execute the actions!
- Click Save.
Define the Actions That Occur When the Process Runs
Next, you will need to define the actions that occur when the process is fired (new project is created). In this case, the action that should occur is adding the selected users to the new project team.
- On the canvas under Immediate Actions, click on + Add Action.
- For Action Type, select Create a Record.
- Enter the Action Name (i.e. "Add Team Member to Project").
- For the Record Type field, select TaskRay Team.
- Under Set field values, select the following for the first row:
- Field = TaskRay Project (already populated)
- Type = Reference
- Value = Record ID
- Field = User
- Type = ID
- Value = enter User ID (This is the User ID that we got in the beginning of the process. Remember, if you have multiple users that you want to automatically assign to new projects, you will need to create additional actions for each individual user.)
If you would like to add additional users to be automatically assigned to the project team, click on + Add Action under Immediate Actions on the canvas and repeat all of the steps in this section.
Activate the Process
- Click Activate.
- In the dialog, click Confirm.
Test it Out!
That's it! Now, let's try out how it's all working. Go to TaskRay and create a new project. In the Project Details, look at the Team tab. The users that you have selected for your team should all be there automatically!