Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Custom license metric

Vengadeshgiri
Tera Contributor

Hello All,

 

I have few entitlements utilized by contractor employees ,each counts 0.25 license.so i have created custom metric and that seems good Im comparing count from user allocation but as per the ootb feature one allocation taking count as 1 the custom metric i created is not working here

 

Is anyone have any idea?

 

Thanks in advance

 

3 REPLIES 3

pr8172510
Kilo Sage

Hi @Vengadeshgiri,

 

The behavior you're seeing is expected if you're relying directly on User Allocations. ServiceNow treats the allocation quantity as the number of rights allocated to the user.

it doesn't automatically interpret a contractor as consuming 0.25 just because you're using a custom metric.

Since your requirement is 0.25 license consumption per contractor, the custom license metric needs to perform that weighting in its Calculation Script rather than simply counting user allocation records.

ServiceNow supports custom license metrics specifically for calculations that aren't covered by predefined metrics, and the calculation is implemented through the custom metric script.

So the logic should be essentially

Contractor users × 0.25 = required licenses

 example

  • 4 contractors → 1 license
  • 8 contractors → 2 licenses
  • 10 contractors → 2.5 licenses

Also verify that the custom license metric is actually selected on the software entitlement and that its allocation type is User.

After reconciliation, check License Metric Results and the License Consumption Explanation to verify that the custom calculation is being applied.

How the things will be compared based on software installations ?

I have to check based on user?

Hi @Vengadeshgiri,

Yes. If your licensing rule is 0.25 license for each contractor using the software, you should use the software installation data and identify the user associated with each installation.

ServiceNow supports custom license metrics with Software Installations (cmdb_sam_sw_install) as the table source and allows the calculation script to implement custom logic.

So your logic should be

Software Installation → Associated User → Is Contractor? → Consume 0.25 license


 example

 

4 qualifying contractor installations/users
× 0.25
= 1 license required
 

Do not compare the result simply with the number of User Allocation records, because OOTB User Allocation Quantity defaults to 1.

Also make sure the custom-metric reconciliation property is enabled

 com.snc.samp.recon.enablecustommetrics as controlling whether custom metrics are applied during reconciliation.

check the user associated with the software installation to determine whether the 0.25 contractor rule applies.