What

This recipe will show you how to

  1. Setup a workflow to email a notification when there are merge requests waiting to be processed
  2. Setup a schedule job to run this workflow on a recurring basis.
  3. Add Duplicate Score Visibility on the Merge People Page

Why

  1. There is currently no notification sent out when someone submits a merge request
  2. The SQL tables used to store merge requests are slightly obscure
  3. We we are processing a duplicate request from another staff member we need to verify the duplicate is legitimate. There is not information on the duplicate merge screen to see what fields match. There is a wealth of information we could show accessible in the PersonDuplicate including the match confidence score and info on what fields match.

How

Setup a workflow to email a notification when there are merge requests waiting to be processed

  1. Start by creating a new workflow with the name Merge Request Email Notification under the Data Integrity Category
  2. Set a description of "Send a simple email with a link to the merge request queue and the open merge request count"
  3. Uncheck Automatically Persisted. That won't be necessary for this simple workflow.
  4. Add a workflow attribute called "mergeRequestCount" of type integer with this description "The count of merge requests waiting to be processed based querying the EntitySetItem table"

Within the Start Activity we are going to add two actions

  1. Set Open Merge Request Count
  2. Conditionally send an email if the count is > 0.

Set Open Merge Request Count Action

Screenshot_2023-01-03_114009.png

  1. Name your first action "Set Open Merge Request Count" and set the type Utility > SQL Run
  2. Update the SQLQuery action field with this value
  3. Set the Result Attribute action field drop down value to the workflow attribute "mergeRequestCount"

Conditionally Send Email Action

Screenshot_2023-01-03_114339.png

  • Name your second action "Send Notification Email" and set the type Communications > Email Send
  • Update the body text, here is what I started:
There are {{ Workflow | Attribute:'mergeRequestCount' }} merge request(s) in the <a href="/reporting/data-integrity/merge-requests">queue</a>

This email was sent from {{ 'Global' | Attribute:'InternalApplicationRoot' }}
  • Set the remaining fields for this action as desired


Setup a schedule job to run this workflow on a recurring basis

Here is what mine looks like

Screenshot_2023-01-03_115322.png

Add Duplicate Score Visibility on the Merge People Page

  1. Navigate to the Merge Page
  2. Add an html content block to the top of the page with this content 
  3. Configure html content block so that SQL is checked within the "Enabled Lava Commands" setting

Duplicate_Scores.png

Notably when you visit an existing merge request you will see a SET parameter in the url. This SET parameter is tied to a record in the EntitySetId table where we can find the Person Alias Ids included in the merge request. From there we pull information PersonDuplicate regarding the match score and matching fields for each pair of alias in the merge request set.

Follow Up

Please don't hesitate to leave a comment or message me on Rocket Chat (@tony.visconti) if you have questions or find any issues with this recipe.

The Rock community site doesn't currently notify recipe authors when you comment below.

Change Log

~2022-08-17 - Initial Draft

~2022-09-01 - Added details on how to add Duplicate Score Visibility to Merge Page
~2022-09-22 - I have found that I am also interested in keeping an eye on the number of records in the Person Duplicate List. You could also leverage this view and include the number of records greater than a specific confidence score in the email notification.
~2023-01-03 - I added detail for setting up a scheduled job, adding Duplicate Score Visibility and fixed various typos