Tutorial 2 - Automatically setting the urgency of a job

Learn how to create an automation that automatically marks jobs as ‘Urgent’ if they are of type ‘Break Fix’.

Overview

In this tutorial you will create an automation that automatically marks a job as Urgent whenever a Break Fix job is created, or an existing job’s type changes to Break Fix. This is a practical example of using the Update Records action to modify a field on a record based on the conditions that triggered the automation.

By the end of this tutorial you will have:

  • Created a new automation
  • Configured a record modified trigger with an EQL filter to match only Break Fix jobs
  • Added and configured an Update Records action to set the Urgency field
  • Saved and activated the automation
  • Tested the automation by creating a Break Fix job
  • Verified the job was automatically marked as Urgent

Prerequisites

  • You must have the Administrator role, or a role that includes the “Modify webhooks and triggered actions” permission.
  • You should be familiar with the automation builder UI. If not, read Get to know the automation builder UI first.
  • Completing Tutorial 1 first is recommended.

Step 1: Create a new automation

The new automation button

  1. In the web app, navigate to Settings > Configuration tools > Automations.
  2. Click New automation.
  3. In the New automation dialog, enter a Name for the automation, for example:
    Tutorial 2 - Mark Break Fix jobs as Urgent
    
  4. Optionally, enter a Description such as:
    Automatically marks a job as Urgent when the job type is Break Fix.
    
  5. Select the Record Modified template.
  6. Click OK to continue to the automation builder.

The automation builder opens with a default trigger step and is pre-populated with an Echo action by default.


Step 2: Configure the trigger

The trigger will fire whenever a Job record is created or updated, but only if the job’s type is Break Fix. You will use an EQL filter to restrict the trigger to matching jobs only.

The trigger step properties panel

  1. On the workflow canvas, click the Trigger step (the blue rectangle). The step properties panel opens on the right.
  2. Under the Trigger section, find the Object type field and select Jobs from the dropdown list.
  3. Under Operations, enable the Insert and Update checkboxes. This tells the automation to run when a Break Fix job is first created, or when an existing job is changed to the Break Fix type.
  4. Under Run when, click Advanced and enter the following EQL expression:
    Previous.Type != Current.Type AND Current.Type == 'Break Fix'
    

This filter ensures the automation only runs when the job’s Type field changes to Break Fix.


Step 3: Replace the Echo action with an Update Records action

The template pre-populates an Echo action as a placeholder. For this automation you need an Update Records action that sets the Urgent field on the job.

The workflow canvas with the Echo action selected

  1. On the workflow canvas, click the Echo step to select it.
  2. Press the Delete key on your keyboard, the trash icon in the top right corner of the step, or click the Delete step button in the step properties panel, to delete it.
  3. In the Steps palette on the left, locate the Update Records action. You can type update in the search box at the top of the palette to find it quickly.
  4. Drag the Update Records step from the palette onto the workflow canvas and drop it onto the placeholder below the trigger step.

Step 4: Configure the Update Records action

The Update Records action properties panel

  1. Click the Update Records step on the workflow canvas to open its properties.
  2. In the Object Name field, select Jobs.
  3. In the Ids field, enter the following workflow variable to reference the job that triggered the automation:
    $trigger.current.UID
    
  4. In the Field assignments parameter, click the + Add field link
  5. In the field dropdown, select Urgency
  6. In the value editor type:
    Urgent
    

This configuration tells the automation to find the specific job that was just created or updated, and set its Urgency field to Urgent.


Step 5: Activate the automation

  1. In the automation builder header, click Activate. This automation is currently a Draft: clicking Activate validates the whole workflow and makes it live in one step. If you’d rather leave it as a draft for now, click Save as Draft instead, and activate it later from the automation detail page.
  2. If there are any configuration errors, they will be highlighted in the builder. Resolve them and click Activate again.
  3. Once saved successfully, click the Close button to leave the automation builder. You will be shown the automation detail page for the automation you just created, now showing a status of Active.

The automation will fire the next time a Break Fix job is created or updated.


Step 6: Create a Break Fix job to trigger the automation

Now you will create a job of type Break Fix to test that the automation fires and updates the job correctly.

  1. Use the Quick create button in the main navigation bar at the top of the page. It’s the white button with the + plus sign in it.

  2. Click + Job in the menu.

  3. On the Job create page, fill in the required fields and set the Type field to Break Fix. So the job is easy to find, set the Description to:

    Test Break Fix Job
    
  4. Save the job.

Creating the job fires an Insert operation on the Jobs object. Because the job type is Break Fix, the trigger filter matches and the automation runs.


Step 7: Verify the job was marked as Urgent

First, confirm the automation ran by checking the activity log, then verify the job itself was updated.

Check the activity log

After creating the job, you should be redirected to the automation detail page. If you are not, navigate to Settings > Configuration tools > Automations and click the name of the Tutorial 2 - Mark Break Fix jobs as Urgent entry.

The automation activity tab

  1. Click the Activity tab.
  2. Each row represents one workflow execution. Click the most recent (topmost) row to expand it and see the individual step messages for that run.

You should see entries similar to:

Timestamp Event type Status Message
{date/time} Trigger Info Automation workflow started
{date/time} Workflow Info Started action ‘update-records’: Update 1 record of type Jobs
{date/time} Workflow Info Completed action ‘update-records’: Update 1 record of type Jobs
{date/time} Workflow Info Automation workflow completed successfully

Note the entries within an expanded execution are ordered oldest to newest, showing the order the steps actually ran in.

Verify the job field was updated

  1. Navigate to the Jobs list and open the Break Fix job you created.
  2. Confirm that the Urgency field is now set to ‘Urgent’.

You should be able to see from the log and the job record that:

  • The trigger detected the new Break Fix job
  • The workflow ran the Update Records step
  • The job’s Urgency field was set to ‘Urgent’
  • The workflow completed successfully

What you learned

In this tutorial you:

  • Configured a trigger with an EQL filter to match only jobs of a specific type
  • Used an Update Records action
  • Used the $trigger.current.UID workflow variable to target the record that caused the trigger
  • Tested the automation and verified the job field was updated correctly

Next steps

  • Experiment with filtering on other job fields, such as Current.JobStatus == 'Complete'
  • Proceed to the next tutorial