I want to populate work notes field from the comments field in alm_hardware table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2025 08:28 PM
I want to populate work notes field from the comments field in alm_hardware table. So that it directly gets logged in activities filter. I want to do this using scripting. Please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2025 09:11 PM
you can use before update business rule and copy the comments to work notes
BR Condition: Comments Changes
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.work_notes = current.comments.getJournalEntry(1);
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2025 11:01 PM
Have wrote this script it is not working.
after saving the record nothing is getting updated in the work notes field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2025 11:05 PM
your business rule should be Before update
what's your BR trigger?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2025 11:12 PM
This is the BR trigger i am using.