Business Rule Script help, Please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2023 07:45 PM
Hello,
The good news is I have everything almost working but I am having trouble with my business rule script. Here is a summary of my progress and the script details.
I created a configuration item called ProjectManagement
I created a variable called configuration item and set the default value to the sys id
This part enabled the configuration to be added(hidden)on the catalog item
I then created a business rule to copy the variable configuration to the Request field called configuration item. So far all of the above has worked as expected.
Then I created a business rule to set the request state to New if the configuration item is Project management. This last part isn't working and changing the state. I set the table to Request, when to run is after, filter confidition is Configuration item changes to ProjectManagement.
Anyone have any ideas why?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2023 09:07 PM
Hello @Gemma4 ,
In the second business rule, you have a typo in the GlideRecord . Instead of GlideRcord, it should be GlideRecord.
Kindly mark correct and helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:18 PM
Hi @Gemma4 ,
you can try this code
(function executeRule(current, previous /*null when async*/) {
// Check if the "Configuration item" field has changed to "ProjectManagement"
if (current.configuration_item.changesTo('ProjectManagement')) {
// Update the request's state to "New"
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
req.request_state = 'New';
req.update();
}
}
})(current, previous);