The CreatorCon Call for Content is officially open! Get started here.

check if string begins with XYZ

Not applicable

Hi, I want to check in a business rule if a string begins with three specific characters. I thought I had read somewhere in the wiki how to do this, but can't find it anymore.

Can anyone assist please?

5 REPLIES 5

Sounds like what you want is to get a list of all incidents in your system whose subtype starts with REQ or TRB. You can do that with a query

var rec = new GlideRecord('incident');
var term = rec.addQuery('u_incident_subtype', 'STARTSWITH', 'REQ');
term.addOrCondition('u_incident_subtype', 'STARTSWITH', 'TRB');
rec.query();
while (rec.next())
do something