Copy comments and work notes history from INC to Case

Community Alums
Not applicable

Hi all!

 

Hope someone has an idea on this...

 

We are in the process of implementing Case management and we want to migrate incident data to cases.  The part I'm stuck on is moving historical comments & work notes from incident to case.  They are in the sys_history_line table and we can copy them but the sys_history_set seems to be a moving target.  

 

Any ideas on how I can essentially copy the history from the incident to the case, specifically just comments and work notes?

 

2 REPLIES 2

Marcos Kassak
Kilo Sage
Kilo Sage

Hi  @Community Alums,

 

You may want to use this on your existing script:

 

current.comments.getJournalEntry(-1); //gets all comments on record

current.comments.getJournalEntry(1); //gets just the last comments entry on the record

 

This is for all journal-type fields, so work_notes will behave the same too.

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍

Thanks,
Marcos Kassak
The world works with ServiceNow!

Community Alums
Not applicable

Hi Marcos,

 

Thanks for the reply.  The data was brought over but since I ran this in a Fix Script logged in as myself, the comments show as if I made the comment; not the original person.  I was hoping to retain the original author of the comment/work note.

 

Thanks,