How to fetch/use "Conditions" section in script ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 12:08 AM
Hi All,
I have below UI with source = sys_user. I am fetching below 1428 records using "Condition" .
If we enter "Per user cost" then we should get "Total cost".
for ex. Per user cost = $50
Filtered User as per Role = 1428
So Total cost = $71400
This user set named as "ITIL" with specified roles in Condition.
How I could access given Condition part in script?
Also, Condition may be vary/dynamic like if some other person create "Admin" user set then he/she may set different condition.
So can we dynamically access the conditions?
Or else
How we could access Count 1428 (marked in yellow) using script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 12:39 AM
The field name is: conditions
So if you creates a GlideRecord, grab the record and then var con = gr.conditions then the value is the query
After that, create a new GlideRecord to sys_user, and use usr.addEncodedQuery(con) to query with the same query as the subscription user set

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 04:23 AM
Thanks Simon
Its helped me to get the count.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 04:27 AM