Ho to fetch different value of "choice field" in system property
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 05:22 AM
Hi All,
As there are different choices available in "choice field" of system property out of box i see. How can i fetech the different value presnt in choice field like "problem_coordinator"
What is the way of doing that ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 05:36 AM
Run below code in background script, you will get the choices.
var prop = new GlideRecord('sys_properties');
prop.addQuery('name','problem.closed.role.reanalyze_from_completed');
prop.query();
if(prop.next())
{
gs.print(prop.choices);
}
There is no direct way to get choices as we have for values through gs.getProperty('problem.closed.role.reanalyze_from_completed');
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 06:13 AM
@Parul Sahu is this working for you now as expected output?
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 07:13 AM
Hi Raghav,
Can we directly use choice field ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 07:27 AM - edited 12-22-2022 07:29 AM
@Parul Sahu what is your exact requirement? I have provided the script to get it, you can use that anywhere.
Since it has comma separated choice field, it will return all.
Raghav
MVP 2023