How to retrieve work notes of a record (incident , sc_request) into catalog form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 12:28 PM
Is it possible to achieve this below scenario
When a user inputs a ticket number in the field, it should display a list of related journal entries/work notes in the field below, allowing the user to select from the options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 06:18 PM - edited 01-14-2025 06:24 PM
To achieve this functionality, you can use a Reference Qualifier and a Dynamic Filter Option in ServiceNow.
To display related journal entries/work notes based on a ticket number in ServiceNow:
- Create Fields:
- Field 1: Ticket Number (Reference to Task table).
- Field 2: Related Journal Entries (Reference to Journal Entry table).
- Set Reference Qualifier:
- For the Related Journal Entries field, add this script:
current.addQuery('element_id', current.u_ticket_number); - This filters journal entries based on the selected ticket number.
- Add Field Dependency:
- Set the Related Journal Entries field as dependent on Ticket Number so it updates dynamically.
- Test:
- Enter a ticket number and verify that the related journal entries populate correctly in the second field.
ɪꜰ ᴍʏ ᴀɴꜱᴡᴇʀ ʜᴀꜱ ʜᴇʟᴘᴇᴅ ᴡɪᴛʜ ʏᴏᴜʀ Qᴜᴇꜱᴛɪᴏɴ, ᴘʟᴇᴀꜱᴇ ᴍᴀʀᴋ ᴍʏ ᴀɴꜱᴡᴇʀ ᴀꜱ ᴛʜᴇ ᴀᴄᴄᴇᴘᴛᴇᴅ ꜱᴏʟᴜᴛɪᴏɴ ᴀɴᴅ ɢɪᴠᴇ ᴀ ᴛʜᴜᴍʙꜱ ᴜᴘ.
ʙᴇꜱᴛ ʀᴇɢᴀʀᴅꜱ
ꜱʀᴇᴇʀᴀᴍ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 12:25 PM
I set the Related Journal Entries field as dependent on Ticket Number but it showing all the records in second field that too displaying only "name" field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 07:08 PM
you will have to query sys_journal_field table where work notes are stored and bring in the data
what script did you try so far and what didn't work?
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
01-15-2025 10:11 AM
I tried this in the variable but it is not working , based on the task number it should display additional comments associated to it