- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 11:23 PM
Hello All,
I need to fetch sctask number from the email body and I need to update the record.
please help me with the script.
example number: SCTASK1234567.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 11:43 PM
Hello,
Below is example of fetching number from Subject, you can replicate for body as well.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 01:53 AM
are you sure your query is correct? and you are having record into stock room table
st.addQuery('name', status)
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 02:22 AM
Thanks, got the issue. My query was fetching only sys_id. i used below syntax to get the field value.
var statusReference = task.u_digilocker.getRefRecord(); // Get the referenced GlideRecord
if (statusReference.isValid()) {
var status = statusReference.name; // Access the 'name' field of the referenced record
gs.info('namee: ' + status);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 11:26 AM
My initial link about fetching number from email body works for you so kindly accept the solution and close the thread.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:57 AM
@Musab Rasheed Accepted the solution,
Thanks.