# Create your first recipe
Build your first recipe with this video guide
Recipes are automated workflows that connect your apps. Each recipe contains a trigger and one or more actions. When you start a recipe, it waits for a triggering event to run the actions.
The following steps guide you through building a recipe that closes a case in Salesforce whenever an issue with the same name is closed in Jira.
# Step 1: Create a new recipe
Go to the Projects page.
Select an existing project or click Create project to create a new one.
Click Create, and then select Recipe.
Enter My first recipe
in the Name field.
Use the Create in folder drop-down menu to select the folder where the recipe should be created.
Ensure Trigger from an app is selected as the recipe starting point, then click Start building. The Setup your recipe menu
# Step 2: Connect to Jira
Search for and select Jira in the Choose an app search box.
Select the Updated issue trigger.
Enter a descriptive and unique name for the connection in the Connection name field.
Select API token in the Auth type field.
Enter the URL of your Jira account in the Host name field.
Enter your Jira account email in the Email field.
Enter your Atlassian API token in the API token field.
How can I create an Atlassian API token?
To create a new API token in Atlassian, complete the following steps:
Go to Account settings > Security.
Click Create API token.
Enter a name for your token in the Name field, and then click Create.
Click Copy to retrieve your new API token.
Click Connect.
# Step 3: Set up the trigger
The following trigger activates whenever an issue is closed in Jira. When you start the recipe, it checks for matching events from the previous seven days.
Switch the When first started, this recipe should pick up events from field to formula mode and enter 7.days.ago
.
Click the Set trigger condition toggle.
Locate the Name
datapill in the Recipe data menu under Updated issue (Step 1 output) > Fields > Status and map it to the Trigger data field.
Locate the Name
datapill
Select contains in the Condition field.
Enter Closed
in the Value field.
Completed Updated issue trigger fields
# Step 4: Connect to Salesforce
Click + Add step, and then select Action in app. The Add step button
Search for and select Salesforce in the Choose an app search box.
Select the Search records (batch) action.
Enter a descriptive and unique name for the connection in the Connection name field.
Select OAuth 2.0 in the Auth type field.
Click Connect to open the Salesforce sign-in dialog. Completed Salesforce connection fields and the Connect button
Sign in to your Salesforce account.
# Step 5: Set up the action
The following action searches for cases in Salesforce with the same case name as the Jira issue.
Select Case in the Search for field.
Enter 150
in the Limit field to restrict the number of records the action returns.
Locate the Summary
datapill in the Recipe data menu under Updated issue (Step 1 output) > Fields > Parent > Fields and map it to the Subject field.
Completed Search for Cases fields
# Step 6: Set up the conditional statement
The following IF condition checks if the matching Salesforce case from the previous step is open. If it is, the recipe closes the case.
Click + Add step, and then select IF condition. The Add step button
Locate the Status
datapill in the Recipe data menu under Search Cases (Step 2 output) > Cases and map it to Data field.
Select does not equal in the Condition field.
Enter Closed
in the Value field.
Completed IF condition fields
Click Select an app and action.
Search for and select Salesforce in the Choose an app search box.
Select the Update record action.
Select Case in the Object field.
Locate the Case ID datapill in the Recipe data menu under Search Cases (Step 2 output) > Cases and map it to the Case ID field.
Select Closed in the Status field. Completed Update case fields
# Step 7: Save and start your recipe
Click Save, then Exit.
Click Start recipe. Your completed recipe should resemble the following screenshot: Example recipe
NEXT STEPS
- Explore the Community library (opens new window) to find ready-to-use recipes built by other users.
- Learn about other types of triggers and actions in Recipe design.
Last updated: 11/25/2024, 4:14:14 PM