Is my business rule condition correct?

DanielG
Tera Contributor

Hello,

 

I created a business rule that runs against the Reassignment History (u_reassignment_history) table.

The condition that I need to trigger against is when the new assignment value is "App Eng"

 

Here is what I added to the advance condition field: 

current.u_new_value == 'App Eng'

 

App Eng is the name of the assignment group. Please see my image to review my business rule:

NOTE - I have a larger script but for now I just have the log statement just to see if the business rule gets triggered by my condition. So far it isn't working.

Screenshot 2023-11-29 at 9.07.59 AM.png

 

I want the business rule to be triggered anytime I change from one assignment group to "App Eng"

Is my condition formatted correctly?

1 ACCEPTED SOLUTION

Community Alums
Not applicable

You can dot walk from there - go to the bottom of the drop down - show related fields

JoroKlifov1_0-1701282018309.png

 

View solution in original post

15 REPLIES 15

Don't see it immediately, though why not using the Filter Conditions instead of a scripted condition?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Because I want to expand my condition. The full condition will look something like this:

 

current.new_value == 'sysID for App Eng' || current.new_value == 'sysID for azure operations'
&& current.task.active == true
&& current.correlation_id == ''

 

with the last two statements I need to dot walk. Can I do that from the condition builder?

Ah just a small misunderstanding of how the filter condition works from your end. Dotwalking is no issue at all for reference fields. I see others also have mentioned that now in the past few minutens.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Danish Bhairag2
Tera Sage
Tera Sage

Hi @DanielG 

 

Y don't u use the condition field in when to run condition instead of writing it in advanced section.

Under when to run u can specify whether it is suppose to run before or after insert/update n below under condition u can select the field of new assignment value is App Eng. Then u der advanced u can put only log remove the value from condition field current.u_new_value.

 

Thanks,

Danish

 

H S B
Giga Guru

1. I would suggest to go ahead & find the sys_id of the assignment group 'App Eng'. You can do that by going to -

  • Application Navigator ( Left Side ) ==> Groups ==> find the group in list view by applying a filter or searching for it ==> right click on it & copy it's sys-id.
  • Update your condition to current.u_new_value=="whatever-sys-id-you-got

2. You can also use the WHEN TO RUN section to put condition as follows by selecting appropriate field & its target value something as follows -
Screenshot 2023-11-29 230707.png

 

Do mark this response as HELPFUL / CORRECT which will help others & motivate me as well.