Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

State is not getting changed

Devansh1
Tera Contributor

Hi All,

There is a BR which check the condition if the assignment group is not empty and assigned to is empty the state should be assigned it is working fine in the workspace, but if record is created via record producer the state is not changing after updating some value it is getting updated. Even in some cases just saving the record it is getting updated,

 

image.png

 

what could be the reason..

 

Thanks,

 

1 ACCEPTED SOLUTION

@Devansh1 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

GlideFather
Tera Patron

Hi @Devansh1

 

please share the BR.

It might be the checkbox on create/update or anything else, please share

_____
This reply is 100 % GlideFather and 0 % AI. Disaster may appear. Deal with it!

Shruti D
Kilo Sage

Hello @Devansh1 ,

Verify if your BR is set to run on: Before Insert and Update.


Please Mark Correct ✔️
 if this solves your query and also mark Helpful 👍 if you find my response worthy based on the impact.

Regards,
Shruti



nityabans27
Kilo Patron

Hi @Devansh1,

Your Business Rule (BR) correctly sets the state to “Assigned” when assignment_group is filled and assigned_to is empty — but fails for records created via a Record Producer because of timing issues.

When created from a record producer, field values are often populated after the BR executes, so the condition isn’t met initially. Later updates or saves re-trigger the BR, and then it works.

Fix options:

  1. Make the BR run Before Insert and Before Update with proper ordering (e.g., order < 100).

  2. Adjust BR order so it executes after other scripts or flows that set the assignment group.

  3. Add the same logic directly in the Record Producer script.

  4. Use a Flow or post-insert script if population is asynchronous.

In short — it’s a sequencing problem. The BR runs before the necessary data exists on record creation via the record producer.