I have a requirement where i have to Move the state of the demand from Submitted to Qualified state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 04:56 AM
I have a requirement where i have to Move the state of the demand table record from Submitted to Qualified state. when all the task that was created in the Submitted state is closed complete or Closed skipped.
I've written a After update business rule as below on demand_task table
when state is one of 'Closed Completed / Closed Skipped '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 10:01 PM
yes i have cross checked everything.., I want to create 5 task when in State is 'Screening' after those demand tasks are approved . the system should move to the 'Qualified ' state

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 05:34 AM
Write After BR on demand_task table like below
(function executeRule(current, previous /*null when async*/) {
if (current.state.changes() && (current.state == 'Closed Complete' || current.state == 'Closed Skipped')) {
var gr = new GlideRecord('demand_task');
gr.addQuery('parent.dmn_demand', current.parent); // or appropriate reference field
gr.addQuery('state', 'NOT IN', 'Closed Complete,Closed Skipped');
gr.query();
if (!gr.hasNext()) {
var demand = new GlideRecord('dmn_demand');
if (demand.get(current.parent)) {
demand.setValue('state', 'Qualified'); // or numeric value for Qualified
demand.update();
}
}
}
})(current, previous);
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 07:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
No need to add conditions, conditions are added directly in script. My code should run. Accept the solution if that helps
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 05:53 AM
Thanks for the help !