Create a custom script in a String field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 09:33 AM
Hello, all.
I am trying to write a script in a String field that checks the Description field for key words to validate the creation of a ticket.
I found this one already setup in my instance, but I am not sure if is working:
I tried using the same code to create a new validation:
Title_codeIN["Loan Officers", "Loan Officer Assistants", "Branch Manager", "Production Manager", "Division Manager", "Regional Manager", "Mortgage Credit Specialist "]
That didn't work so I tried altering it to look like this:
descriptionCONTAINS"Loan Officer"^ORdescriptionCONTAINS"Loan Officer Assistant"^ORdescriptionCONTAINS"Branch Manager"^ORdescriptionCONTAINS"Production Manager"^ORdescriptionCONTAINS"Division Manager"^ORdescriptionCONTAINS"Regional Manager"^ORdescriptionCONTAINS"Mortgage Credit Specialist"
The description field looks like this and I want it to check the Title field or any text within the description field:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 05:52 AM
Or is there a better way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 06:18 AM
Hi @David Garcia ,
Not sure what the business requirement but 2nd approach works. If you can tell me your Business requirement then i can may suggest you some alternative way.
descriptionCONTAINS"Loan Officer"^ORdescriptionCONTAINS"Loan Officer Assistant"^ORdescriptionCONTAINS"Branch Manager"^ORdescriptionCONTAINS"Production Manager"^ORdescriptionCONTAINS"Division Manager"^ORdescriptionCONTAINS"Regional Manager"^ORdescriptionCONTAINS"Mortgage Credit Specialist"
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 06:34 AM
What's your business requirement for this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 10:29 AM
The business requirement is to only have a ticket created when the Title equals those titles listed. As of right now, a RITM drops for all titles. The first image in my original post is from a custom table that was created to act as a Trigger to create a RITM depending on if a box is checked on a form outside of ServiceNow.