GRC: flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello Techies,
Need some help to create flow designer. I have some conditions to create flow designer. That is , Automatically closer of incident record after 30th day of updated date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
39m ago
First Refer KB: KB0552820 How to customize incident autoclosure
Option 1 : Update System Property (Recommended) , OOB
Locate the property "glide.ui.autoclose.time". Change the value to 30
Set property "com.snc.incident.autoclose.basedon.resolved_at". to true
Refer : Servicenow Doc: Configure incidents to close automatically
Option 2 : Scheduled Job : If you want to close incidents completely automatically using custom logic or target another stage entirely, you can create a Custom Scheduled Job.
Refer : How to auto Resolve Incidents that are 30 days or older
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
29m ago
<p>Hii @MuppuriNagaraju ,
Step 1: Create the Flow and Define the Trigger
Since this needs to check for incidents every day, a Scheduled trigger is the best approach.
Navigate to Process Automation > Flow Designer and click New > Flow.
Name your flow (e.g., Incident Auto-Closure - 30 Days) and click Submit.
In the Trigger section, select Scheduled.
Set it to run Daily at a low-traffic time (e.g., 12:00 AM or 1:00 AM).
Step 2: Look Up the Matching Incidents
You need to find all incident records that haven't been updated in 30 days and are still active.
Click Add an Action, Flow Logic, or Subflow and select Action.
Search for and select the Look Up Records action (under the ServiceNow Core application).
Configure the action with these details:
Table: Incident [incident]
Conditions: * Active is true
AND State is Resolved (Note: It is best practice to auto-close from 'Resolved' to 'Closed', but you can change this to match your target state).
AND Updated relative before 30 Days ago
Step 3: Loop Through and Close Each Incident
Since the lookup step returns a list of records, you must use a loop to update each incident individually.
Click Add an Action, Flow Logic, or Subflow and choose Flow Logic.
Select For Each.
Drag and drop the Incident Records data pill from your Look Up Records step into the Items field.
Inside the loop (click the + icon under For Each😞
Select Action and choose Update Record.
Drag the Incident Record data pill from the For Each loop into the Record field.
Add the following fields to update:
State = Closed
Close notes = Automatically closed by Flow Designer after 30 days of inactivity.
Closed by = System Administrator (or a specific integration/automation user profile).
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards</p>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14m ago
Hi @MuppuriNagaraju,
You can achieve this either using Flow Designer or a Scheduled Job.
I would recommend using a Scheduled Script Execution for this requirement because it is simpler and more efficient for bulk auto-close operations.
cheduled Flow:
- Run Daily
- Look up incidents where:
- State is not Closed
- Updated before 30 days
- Use For Each loop
- Update incident to Closed
Scheduled Job Approach
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.addQuery('sys_updated_on', '<', gs.daysAgoStart(30));
gr.query();
while (gr.next()) {
gr.state = 7; // Closed
gr.active = false;
gr.close_notes = "Automatically closed after 30 days of inactivity";
gr.update();
}