I want to change the status to Closed when the status changes to Resolved.

Kentaro Numata
Tera Guru

Hello, It's Kentaro.

 

I tried two types of Filter Conditions in business rules.
But the Action is not executed.

 

 

Filter Conditions 1

Filter Conditions_1.png

 

Filter Conditions 2

Filter Conditions_2.png

 

Action

Action.png

 

 

Please let me know if there are any mistakes

 

Thannks,

Kentaro.

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

@Kentaro Numata  If you want to do it without script, you can do so, but closed by field will not populate. See the below screenshots.

AnveshKumarM_3-1700535993251.png

 

 

AnveshKumarM_2-1700535973881.png

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

 

 

Thanks,
Anvesh

View solution in original post

3 REPLIES 3

AnveshKumar M
Tera Sage
Tera Sage

Hi @Kentaro Numata 

This has to be handled a bit different, along with state we need to set few other fields and I feel it should be done through script. Please change your BR and Advanced one and before - update, like the one shown below.

 

Advanced : True

When: Before

Update: True

Condition: State :: Changes to :: Resolved

 

AnveshKumarM_0-1700535662951.png

 

And in the script field in Advanced section, use the following code,

 

(function executeRule(current, previous /*null when async*/ ) {

    current.incident_state = IncidentState.CLOSED;
    current.state = IncidentState.CLOSED;
    current.active = false;
    current.closed_by = current.resolved_by;

})(current, previous);

AnveshKumarM_1-1700535716787.png

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Anvesh

AnveshKumar M
Tera Sage
Tera Sage

@Kentaro Numata  If you want to do it without script, you can do so, but closed by field will not populate. See the below screenshots.

AnveshKumarM_3-1700535993251.png

 

 

AnveshKumarM_2-1700535973881.png

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

 

 

Thanks,
Anvesh

Hello.

 

Thank you so much!!!!!!!!!!!!

I was able to implement it!!!

 

Thanks,

Kentaro.