How to get a business rules to run only on the first time an incident is set to Resolved state?

Renata C
Giga Contributor

I have a business rules that I need to run only on the first time an incident is set to RESOLVED state, if it goes back to any other state and then it is set to resolved again I don't wan't the business rule to run on it again.
I thought of a few ways but no luck so far, at this point I am doubting my knowledge on BRs, any help is appreciated.

1 ACCEPTED SOLUTION

Yes, that is something I was trying to avoid, but it is the easiest way to do this. Thank you for replying.

View solution in original post

10 REPLIES 10

sachin_namjoshi
Kilo Patron
Kilo Patron

There is an column on incident table "Resolved " which gets populated after incident is resolved.

You can use this column value in your business rule condition.

 

find_real_file.png

 

 

You can write a condition in your business rule to trigger only during first resolution

 

current.state == "6" && JSUstil.nil(resolved_at) 

 

Also, please make sure "resolved" column on incident table is read only so that your business rule works.

Regards,

Sachin

There is a small typo in business rule condition.

Use below

 

current.state == "6" && JSUtil.nil(resolved_at) 

 

Regards,

Sachin

Thank you for your reply.

That would work only if once I Reopened the incident the info on the field was not cleared, unfortunately it gets cleared so I can't use that condition.

Hi,

have you tried

current.setWorkflow(false);

thanks