Resolution notes for incident resolved on the emplyee center

ahmed-24
Tera Expert

Hello; guys

I need to show the resolution notes for incident when it's resolved for caller on the employee center 

ahmed24_0-1769439035307.png

 

Can anyone know how to do it please? 

Thank you so much

1 ACCEPTED SOLUTION

Hello @Najmuddin Mohd  i already created one ! After

Condition : update 

When :  after 

Condition :

State changes to resolved 

Resolution notes is not empty 

Script : 

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

    // 6 = Resolved, 7 = Closed in OOTB instances
    var becameResolved = current.state.changesTo(6);
    var becameClosed   = current.state.changesTo(7);

    if ((becameResolved || becameClosed) && !gs.nil(current.close_notes)) {

        var msg = "Resolution: " + current.close_notes.toString();

        // write a customer-visible journal entry
        current.comments.setJournalEntry(msg, current.resolved_by || current.closed_by || gs.getUserID());
    }

})(current, previous);
 
But it doen't works
 

View solution in original post

4 REPLIES 4

Najmuddin Mohd
Mega Sage

Hello @ahmed-24 ,

Instead of modifying the OOB widget by showing Resolution notes in the Activity tab, whenever the incident is Resolved, add the Resolution notes to the Comments by writing a Business rule.


If the above information helps you, Kindly mark this post as Helpful and Accept the solution.
Regards,
Najmuddin

Hello @Najmuddin Mohd  i already created one ! After

Condition : update 

When :  after 

Condition :

State changes to resolved 

Resolution notes is not empty 

Script : 

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

    // 6 = Resolved, 7 = Closed in OOTB instances
    var becameResolved = current.state.changesTo(6);
    var becameClosed   = current.state.changesTo(7);

    if ((becameResolved || becameClosed) && !gs.nil(current.close_notes)) {

        var msg = "Resolution: " + current.close_notes.toString();

        // write a customer-visible journal entry
        current.comments.setJournalEntry(msg, current.resolved_by || current.closed_by || gs.getUserID());
    }

})(current, previous);
 
But it doen't works
 

Since your BR only run on state of resolution all the other code is not necessary. Also you had the format for setJournalEntry incorrect. I should be commons not or symbols.

(function executeRule(current, previous /*null when async*/) {
    var msg = "Resolution: " + current.close_notes.toString();
    // write a customer-visible journal entry
    current.comments.setJournalEntry(msg, current.resolved_by, current.closed_by, gs.getUserID());
})(current, previous);

  

Hello @ahmed-24 ,

I tried and it's working.

NajmuddinMohd_0-1769444994621.png



NajmuddinMohd_1-1769445042122.png

 

NajmuddinMohd_3-1769445077974.png

 



NajmuddinMohd_2-1769445054697.png


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin