- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:26 AM
how can i use contains in the 'condition' of a BR? Or use contains in my if statement? The below syntax does not work
if(curent.name, 'CONTAINS', 'foo=bar'){
//do something
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:31 AM
I've done something like this:
str = current.comments;
var pos = str.search('Update from Request Item');
if(pos == -1){
gs.info('The push from Task to RITM will trigger now: ' + current.comments);
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.comments = 'Update from Task "' + current.short_description + '": ' + current.comments;
gr.update();
}
In your case, I would say != -1, to indicate it found your string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 08:31 AM
I've done something like this:
str = current.comments;
var pos = str.search('Update from Request Item');
if(pos == -1){
gs.info('The push from Task to RITM will trigger now: ' + current.comments);
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.comments = 'Update from Task "' + current.short_description + '": ' + current.comments;
gr.update();
}
In your case, I would say != -1, to indicate it found your string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 07:15 AM
Thank you!
