Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Copy all worknotes from incident on the worksspace

Chandler2
Tera Guru

Hi All,

 

I want to copy all worknotes from Interaction to Incident when user clicks Create incident on the worksspace view.

 

Now, there are multiple Create Incident on Interaction table but I am taking the one which has "Workspace Form Button" as true.

 

There is a line of code:

inc.work_notes = gs.getMessage('Incident created from Interaction {0}', current.number); // This seems to be working fine
 
Now I added below line so I can copy all the worknotes but it doesn't work
I would like to append it to the above entry itself but it is not doing anything at all.
 
inc.work_notes = current.getJournalEntry(-1);  //What is the issue here?
 
I also tried     inc.work_notes = current.interaction.getJournalEntry(-1);  // This one also doesn't work
 
Please suggest the reason.

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Mega Patron

Hi @Chandler2 ,

I have updated the Create Incident UI action and tested it's working for me try this out

inc.work_notes = current.work_notes.getJournalEntry(-1)

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

10 REPLIES 10

Robbie
Kilo Patron
Kilo Patron

Hi @Chandler2,

 

Have you tried:

inc.work_notes = current.work_notes.getJournalEntry(-1); 

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

Yes, I tried this as well. It doesn't do anything.

Chaitanya ILCR
Mega Patron

Hi @Chandler2 ,

I have updated the Create Incident UI action and tested it's working for me try this out

inc.work_notes = current.work_notes.getJournalEntry(-1)

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Yes, I tried this as well. It doesn't do anything.

 

inc.work_notes = current.work_notes.getJournalEntry(-1);
Didn't make any difference.