- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Community,
We are working on a requirement for a ServiceNow License Optimization Dashboard where we need to calculate Fulfiller and Stakeholder users based on their assigned roles.
The business requirement is:
- Fulfiller: Active users who have at least one defined Fulfiller role.
- Stakeholder: Active users who have at least one defined Stakeholder role, excluding users who have any Fulfiller role.
- If a user has both Stakeholder and Fulfiller roles, the user must be counted only as Fulfiller.
- Each user should be counted only once, regardless of how many roles they have.
For example:
| User A | No | Yes | Stakeholder |
| User B | Yes | No | Fulfiller |
| User C | Yes | Yes | Fulfiller only |
| User D | Multiple | Multiple | Fulfiller only |
Our current data is based on sys_user_has_role, where a single user can have multiple role records. Therefore, we need to count distinct users (sys_user), rather than role records.
Question
What is the recommended ServiceNow approach to implement this logic in a License Optimization Dashboard?
Specifically, should we use:
- A Report/Data Visualization with a scripted condition?
- A Database View joining sys_user and sys_user_has_role?
- A Scripted Data Source?
- A Performance Analytics indicator?
- Another OOB ServiceNow capability?
We would particularly like guidance on how to efficiently implement:
Stakeholder users = Active users with stakeholder roles – users who have any fulfiller role
while ensuring distinct user counting and avoiding duplicate counts caused by multiple role assignments.
Any recommendations, examples, or OOB approaches would be appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @vjanaga1 ,
For this requirement, I would avoid trying to handle the logic entirely within a standard report on sys_user_has_role, because the same user can have multiple role records and you'll have to account for distinct users and the Fulfiller-over-Stakeholder precedence.
A better approach would be to create a Scripted Data Source or a dedicated reporting table that produces one record per active user with their final classification.
The logic would be:
If Active = true
If user has any Fulfiller role
Classification = Fulfiller
Else if user has any Stakeholder role
Classification = StakeholderThis automatically handles users with multiple roles and ensures each user is counted only once.
You can then build your Dashboard/Data Visualizations against that dataset and simply count users by Classification.
If you're using Performance Analytics, a scripted indicator can also implement the logic, but for a license dashboard where you need the classification to be easily reported and reused, I would lean toward a Scripted Data Source/custom reporting table.
I would also recommend maintaining the lists of Fulfiller and Stakeholder roles in a configuration table rather than hard-coding role names in the script. That makes the solution easier to maintain when your licensing model changes.
A Database View can help with joining the tables, but by itself it doesn't solve the "Fulfiller takes precedence over Stakeholder" and distinct-user classification very cleanly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @vjanaga1 ,
For this requirement, I would avoid trying to handle the logic entirely within a standard report on sys_user_has_role, because the same user can have multiple role records and you'll have to account for distinct users and the Fulfiller-over-Stakeholder precedence.
A better approach would be to create a Scripted Data Source or a dedicated reporting table that produces one record per active user with their final classification.
The logic would be:
If Active = true
If user has any Fulfiller role
Classification = Fulfiller
Else if user has any Stakeholder role
Classification = StakeholderThis automatically handles users with multiple roles and ensures each user is counted only once.
You can then build your Dashboard/Data Visualizations against that dataset and simply count users by Classification.
If you're using Performance Analytics, a scripted indicator can also implement the logic, but for a license dashboard where you need the classification to be easily reported and reused, I would lean toward a Scripted Data Source/custom reporting table.
I would also recommend maintaining the lists of Fulfiller and Stakeholder roles in a configuration table rather than hard-coding role names in the script. That makes the solution easier to maintain when your licensing model changes.
A Database View can help with joining the tables, but by itself it doesn't solve the "Fulfiller takes precedence over Stakeholder" and distinct-user classification very cleanly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi Ajmal,
Thank you for the recommendation on the License Optimization Dashboard requirement.
I would like to proceed with the Scripted Data Source / dedicated reporting table approach you suggested. Could you please help me with the steps to create and configure the Scripted Data Source for this requirement?
In particular, I would appreciate your guidance on implementing the logic for:
- Counting each active user only once.
- Classifying users with any Fulfiller role as Fulfiller.
- Classifying users as Stakeholder only when they have no Fulfiller role.
- Maintaining the Fulfiller/Stakeholder role lists through a configuration table rather than hard-coding them.
Thanks in advance for your help!
Regards,
Venkatesh