Skip navigation
Share This:

Inspired by Paula Drew's question Auto create a Problem ticket, this article walks you through creating a Flow and a Process, two of Salesforce’s most powerful clicks-not-code development tools, to auto-create a Problem from an Incident. Credit  goes to Bryan Heidenreich as he developed a similar solution for our use at Fruit of the Loom, Inc. to auto-create problems for every priority 1 incident.

 

If this is your first time using Flows or Processes, I highly recommend you check out these great tutorial resources:

 

First, we’ll create a Flow that will use two Record Create elements to create a new Problem record copying over fields from the original Incident then create an Incident-Problem link record to associate them together. After defining the Flow, we’ll create a Process (instead of workflow rule) to monitor the incident object for changes we’re interested in and launch our Flow when appropriate.

 

Go to Setup | Create | Workflows & Approvals | Flows

1.png

Click the New Flow button

2.png

In the flow designer, on the left sidebar, switch to Resources panel and double-click SObject Variable to create a new input variable for the flow. Later when we setup the Process that monitors for when the incident records are closed (or whatever your criteria is), the Process will pass the incident record to the flow referenced as this flow variable. This variable will allow the rest of the flow steps to know the incident’s fields to use them when creating a new Problem record.

3.png

In the pop-up screen, name the variable varIncident (as convention, I always prefix my flow variables with ‘var’). Make sure the Input/Output Type is Input Only. Set the Object Type to BMCServiceDesk__Incident__c (this is the API name of the Incident object). Click OK button.

4.png

In the flow designer, on the left sidebar, switch to the Palette panel and drag the Record Create element to the canvas on the right.

5.png

Give this flow step a name like Create Problem. In the Assignments section, type the API name of the Problem object BMCServiceDesk__Problem__c.

6.png

Next, choose assignments for each of the Problem object’s fields you want to set when this record is created. In this example, we copy the incident’s category, impact, urgency, description, and ownerId. We set the Problem Source field to text value “Incident”.

7.png

At the bottom of this screen, we need to define which flow variable we want the newly created Problem record ID to be stored in so that we can reference it in our next flow step to actually link the incident and problem records together.

8.png

Click the drop-down arrow to the right of the field, some new options will appear. Click CREATE NEW then choose Variable.

9.png

Type the name of this new variable as varProblemId then click OK. We can leave the Input/Output Type as Private because no other operations outside of this flow need to use this variable.

10.png

Click the OK button and the variable screen will close and you should now see {!varProblemId} in the Variable assignment back on the Record Create screen we were working in. Now click the OK button to close the window.

11.png

So far, our flow canvas should have one Record Create element on it:

12.png

Now drag another Record Create element from the Palette onto the canvas below the existing “Create Problem” flow step we just configured. We will use this element to create the “incident problem link” record. Give this step the name Link Incident to Problem and type BMCServiceDesk__Incident_Problem_Link__c in the Create form field. In the Assignments section, set the FKIncident and FKProblem fields to the {!varIncident.id} and {!varProblemId} respectively as shown in this next screen shot. Since we won’t need the ID of this linkage record for any other parts of this flow we can skip the last step “Assign the record ID to a variable” and just click the OK button.

13.png

Our flow canvas should look like the below screenshot when two Record Create elements. Like any flow chart, we need to specify where we start and how the actions should flow from one step to the other.

14.png

With your mouse, hover the “Create Problem” step. Three new icons appear, click the green circle to indicate this is the start element. Next, with your mouse click the diamond at the bottom of the “Create Problem” step and drag onto the “Link Incident to Problem” step. This tells the Flow that when it is invoked that processing should begin in the “Create Problem” step then go to the “Link Incident to Problen” step. Finally, click the Save button in the upper-left of the screen to save our flow.

15.png

On the save flow screen, give your flow a name like BMCRF – Create and Link Problem to Incident Flow (I prefix my flow names with BMCRF to let me know this is for BMC’s RemedyForce) then click OK button. The other text fields will auto-generate based on what you enter into the name field.

16.png

Make sure to Activate this flow. Pull up the detail page of the newly created flow in Setup and click the Activate link as shown below. Only active flows can be invoked by Processes, which is what we will configure next.

17.png

We’re halfway done! Now go back to Setup so we can create the Process that will invoke this Flow.

 

Go to Setup | Create | Workflows & Approvals | Process Builder

18.png

On the Process Builder page, click the New button in upper-right. Give your process a Name like BMCRF – Create Problem from Incident and a description of the purpose of this flow. The API Name will auto-generate from the Name you provided. Click Save button.

19.png

The flow canvas will appear. Click Add Object in the upper-left of the process flow.

20.png

In the Object field of the form that appears on the right, type Incident then choose when this process should be triggered. In this example, we choose “when a record is created or edited” so that we can check for criteria when the incident becomes closed (or whatever criteria you might have when you want a Problem record to be created). Click Save button.

21.png

Now we need to add some criteria to control when our actions will occur. If you’re familiar with workflow rules, this is like setting up the evaluation criteria for when the workflow rule should run. Click the Add Criteria button on the process canvas.

22.png

Give this criteria step a name, like “State Closed”. Choose to execute actions when “filter conditions are met”. Add criteria condition when the “State Open” field equals False. Then, to make sure this action only is invoked when the incident first changes from state “open” to “closed”, check the last checkbox indicating we only want this action processed when “specified changes are made to the record”. This means that if the incident is already closed and it somehow is updated again then this action won’t run (i.e. won’t create more and more problem records from an already closed incident). Click Save button.

23.png

24.png

In the Immediate Actions section for when this criteria step evaluates to true, click Add Action.

25.png

Choose Flows as the Action Type. Give a name of this action like Create Problem from Incident then choose our flow we created earlier in this article. At the bottom of that form it tells us we can set flow variable values. This is great because we want to pass in a reference to the incident evaluated in this Process to our Flow (remember the varIncident variable we created at the beginning?). Click the Add Row button.

26.png

The screen now asks us which flow variable we want to set. You will only see flow variables with Input/Output Type of either Input Only or Input/Output shown here. Select our varIncident variable.

27.png

For the value, click the search field on the right and a new screen will pop-up similar to when we were adding criteria. Instead of choosing a field, simply click the API object name BMCServiceDesk__Incident__c then click the Save button. That window will close and you’ll see that our varIncident variable is now referencing the incident object – the value will be the incident being evaluated by this process and will be passed to the flow. Click the Save button to save this action step.

28.png

29.png

We’re done configuring our Process, now click the Activate button in the top-right of the page.

30.png

Now it’s time to test out our new Process and Flow! Go to Remedyforce Console and create a new incident.

31.png

Now close the incident (or make some edit that matches the criteria you used when defining your Process).

32.png

Make sure you’ve added the Linked Problems related list to your incident page layout. You should now see your new problem record in the Record Details section!

33.png