We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Update resolution Notes on Incident form based on solution

Rutuja K
Giga Guru

Hi,

There are 2 field on INC form, 1 solution, 2. Resolution Notes(Mandatory)

I am confused how to configure below scenario, 

If solution is empty and Resolution Notes is updated, I want to set solution = Resolution Notes.

If solution is not empty and Resolution Notes is updated, set Solution = Solution + Resolution Notes.

 

And Vice versa i.e. 

If Resolution Notes is empty and Solution is updated, I want to set Resolution Notes = Resolution Notes.

If Resolution Notes is not empty and Solution is updated, set Resolution Notes = Solution + Resolution Notes.

 

Thank You!

 

1 ACCEPTED SOLUTION

Sanjeeva Reddy1
Giga Guru

Hi Rutuja,

 

I tried with below code and it looks fine to me. You can create a Business Rule.

When: after

Update: True

Script:

(function executeRule(current, previous /*null when async*/ ) {
    if (current.u_solution.isEmpty() && current.close_notes.changes()) {
        current.u_solution = current.close_notes;
    } else if (!current.u_solution.isEmpty() && current.close_notes.changes()) {
        current.u_solution = current.u_solution + ' ' + current.close_notes;
    } else if (current.close_notes.isEmpty() && current.u_solution.changes()) {
        current.close_notes = current.u_solution;
    } else {
        current.close_notes = current.close_notes + ' ' + current.u_solution;
    }
    current.update();
})(current, previous);
 
I just want to check with you on below:
----------
If Resolution Notes is empty and Solution is updated, I want to set Resolution Notes = Resolution Notes. ---> Why do you need to set Resolution Notes again since Resolution Notes is empty?
----------
 

If the answer has helped you, please mark the answer as correct/helpful.

 

Regards,

Sanjeeva.Y.Reddy.

View solution in original post

8 REPLIES 8

Danish Bhairag2
Tera Sage

Hi @Rutuja K ,

 

When u want this to happen?

Like when some1 clicks on Resolve button that time? 

 

Thanks,

Danish

Whenever someone update any of Solution or Resolution Notes field.

Hi @Rutuja K ,

 

U can create a after Update BR with condition as Resolution notes changes or solution changes.

 

N try below script

 

current.solution = current.solution + " " + current.resolution_notes;

 

current.resolution_notes = current.resolution_notes +" " + current.solution;

 

Thanks,

Danish

 

Sohail Khilji
Kilo Patron

Hi @Rutuja K,

 

You can do this with after update business rule , did you start with the script ? were are you struck ?

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect