- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 08:56 AM
Hi,
I have written below script include to fetch category values:
In service portal, the category not fetching correctly. it showing all the values. please let me know the corrections.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 12:00 PM
Hi,
This can be done using contain or startswith, what she need is does not start with.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 12:52 PM
Dear Deepa12,
Hi @Deepa12 . Hope you're doing great!
getcategory: function()
{
var category_array = new Array();
var cate = new GlideRecord('sys_choice');
cate.addQuery('name', 'STARTSWITH', 'incident');
cate.addQuery('language', '=', 'en');
cate.addQuery('element', 'STARTSWITH', 'category');
cate.addQuery('inactive', '=', 'false');
cate.addQuery('value', 'CONTAINS', 'GPS%');
cate.addQuery('value', 'CONTAINS', 'WFM%');
cate.query();
while (cate.next()) {
category_array.push(cate.value.toString());
}
return category_array;
},
Can you please try and let me know if it's working?
Kindly, please mark my solution as Helpful/Correct, if applicable. If I could help you with your Query then, please hit the Thumb Icon and mark as Correct!!
Thanks & Regards,
Revanth. K
Product Test Automation Engineer