Community Alums
Not applicable

Community member Rick Hanks posted a fascinating question: How can you estimate the cost required to reach compliance in the situations where you do not own enough software rights to cover the software rights used in your environment. You can see the original post here: License Compliance.

This seems like a very reasonable question. If you are out of compliance, you may want to use this estimated cost to determine whether or not to purchase more rights for the software or to take some other approach towards compliance, such as removing installations.

First thought here might be to approach this with a calculated field based on the Immediate compliance number. Even a little searching around the wiki and community, though, shows that calculated fields are for display purposes and not for reporting, and this is clearly information you want to report on.

A better approach here is to create a field (or in this case fields, as I will explain momentarily) to support this information and populate it through a Business Rule.

Configure the Calculation

When it comes to compliance in Software Asset Management (SAM), ServiceNow provides two different numbers: Immediate and Planned compliance. Immediate compliance shows how many rights you need to be compliant with the vendor as of right now. Planned compliance takes into account systems and users entitled to use the software but do not have it installed. To work with both of these, you need to set up the fields to capture the costs on the Software Counter Results table, not the Software Counter table. This has the added benefit of showing the costs broken out by department, location, or other method you use to group the software with the count.

The calculation itself is pretty simple: it is the number of rights needed to be compliant multiplied by the cost per right. The compliance numbers are easy. You can find these right on the Software Counter Result:

2015-06-30_14-07-27.png

The cost also is not difficult, but you need to make sure you have the information available. The best place to store this information is the Cost field in the Software Model record:

2015-06-30_13-59-26.png

Next you need to create fields to store this information. From a Software Counter record, open one of the Software Counter Results. Add two new Currency fields to the form:

  1. Immediate cost
  2. Planned cost

2015-06-30_14-11-45.png

Now comes the tricky part: how do you populate this field? This involves a Business Rule that runs when you create or update a Software Counter Result, which happens when you run a license count. Create the Business Rule to run after Insert and Update. Select the Advanced option and use this script:

function onAfter(current, previous) {

      current.u_compliance_now_cost = current.compliance_now * current.counter.model.cost;

      current.u_compliance_plan_cost = current.compliance_plan * current.counter.model.cost;

      current.update();

}

2015-06-30_16-19-50.png

Note: you may need to update the names of the cost fields if you call them something different in your environment.

Capture the Cost

With the fields created and the Business Rule in place, the process to capture the estimated cost to become compliant is almost as easy as doing a Count licenses in the Software Counter. I say almost because the way the Software Counter Results cache, you need to choose the option to Rebuild SAM cache the first time you want to capture this information. Otherwise the Software Counter Result records never update for the calculation to perform.

2015-06-30_15-34-23.png

When the count completes, you can navigate to the Software Counter Result record to see the estimated costs.

2015-06-30_15-42-48.png

Report the Cost

With the cost information available now, you want easier ways to access that information so you do not need to go to the Software Counter Result record every time you want this information.

One place to make this information more readily available is right in the Software Counter Results related list on the Software Counter record. Add the fields to the list view (or have your System Administrator add them) and even add a List Calculation to get the total.

2015-06-30_15-50-41.png

You can also create a report to show all the cost information associated with software compliance. To ensure you only show records where you have this data, set filter conditions to only show where Planned compliance AND Planned cost are greater than zero. Because Planned compliance is always greater than or equal to the Immediate compliance, this gives you the records where you have compliance numbers.

2015-06-30_16-03-31.png

Another useful report here can help you to identify where you still need to determine the cost for compliance, either because you have not identified a cost on the Software Model or because you have not rebuilt the SAM cache. This report is very similar, but you want to identify where the Planned cost is still set to 0 while the Planned compliance is greater than 0.

2015-06-30_16-07-58.png

There you have it! A method to estimate how much compliance will cost you. As this information is based on a general cost, it may not factor in any volume discounts you might negotiate or account for other processes you might use to reach a compliant state, such as software removal, but this information can certainly be valuable from a planning perspective. Regardless, these costs will be less than the penalties for non-compliance   in the case of an audit, so it is good to be proactive.