Automatically changing the 'incident state' when a comment is added

m_ahmedmod
Giga Contributor

I'd like to change the state of an incident when it is updated by a caller.

If an incident requires additional information from a caller the analyst would change the 'incident state' to "Awaiting User Info" (4). I would like to configure ServiceNow so that if the customer adds a new comment it would switch the 'incident state' to "Active" (2).

What would be the best way to go about doing this?
I was thinking an 'after' 'update' business rule:

Condition: current.incident_state == 4 && current.comments.changes()

Script:
current.incident_state = 2;

But as it doesn't work I'm thinking there's something wrong with it.

Thank you.

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

Try a 'before' business rule instead.


View solution in original post

6 REPLIES 6

Hi Avani Shah,



Replace the condition as below in the Business rule.


Condition: previous.incident_state == 4 && current.comments.changes() && !gs.hasRole("admin")


A quick question. Why is the condition precious.incident_state? In my mind wouldnt it be current.incident_state == 4 since it hasnt been changed yet?