How do I reset closure codes and notes on Incident reopen?

mattweinell
Kilo Explorer

Hello all!

I was recently made a ServiceNow administrator and am very new to the program. Our instance is slowly taking its proper shape as our operators become familiar with the program so we are paying more and more attention to customizable and scriptable aspects of the program.

Recently it was brought to my attention that when an Incident is reopened, the close code and close notes do not return to their default state so when the Incident is closed again (we are circumventing the 'Resolved' state at the moment but will institute it at a later date) it uses the original close code and close notes.

Is there a way, upon Incident reopening, to move the current close notes to a work notes entry and reset the closure information fields to their default state?

-Matt

1 ACCEPTED SOLUTION

Oops, you're right. This should work:



current.state.changes() && previous.state == 3


View solution in original post

9 REPLIES 9

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Matt,



You could use a before update business rule to do this.



The condition would be when the state changes and the state is not closed:


current.state.changes() && current.state != 3



Then in your business rule you would want to copy the close notes and close code to the work notes and clear out those fields:


current.work_notes = "Close code: " + current.close_code + "\nClose notes: " + current.close_notes;


current.close_code = "";


current.close_notes = "";


Thank you for the speedy reply!



The scripting is exactly what I was looking for - I do have one concern though and I apologize if I seem thick, but wouldn't this affect other Incidents whose state changed as well? Is there a way to specify tickets whose state changed from closed to something else?



-Matt


Oops, you're right. This should work:



current.state.changes() && previous.state == 3


Thank you so much!



(And our operators thank you too)