How to get License info for Service Manager using Javascript

34 views Asked by At

I need to get my SM license components using a scriptLibrary instead of using the GUI. Is there a table where I can perform a search or another way to get that information?. Any advise would be helpful.

1

There are 1 answers

0
Alexis Ruiz On BEST ANSWER

You can use the next function to get some information related to your licensing:

function getLicenseInfo() {
var license = system.functions.get_module_license();

for (var i in license) {
var module = system.functions.strraw(license[i], ",");
var module1 = module.split(",");

if (module1[0] == "Self Service Ticketing") {
print(module1[0] + " " + module1[2] + "(Unlimited)");
} else {
print(module1[0] + " Named License " + module1[1] + "(" + module1[3] + ")" + " Float License " + module1[2] + "(" + module1[4] + ")");
}
}
}

Your output might look like the following:

Smart Analytics Named License 0(0) Float License 0(0)
Asset Contract Management Named License 0(140) Float License 1(140)
Scheduled Maintenance Named License 0(1890) Float License 0(70)
Problem Management Named License 0(1890) Float License 1(70)
Contract Management Named License 0(140) Float License 0(140)
SLA Named License 0(1890) Float License 1(70)
Service Desk Named License 0(1890) Float License 1(70)
Login License Named License 1(1890) Float License 0(70)
Request Management Named License 0(140) Float License 1(70)
Change Management Named License 0(1820) Float License 1(0)
Configuration Management Named License 0(1890) Float License 1(70)
Incident Management Named License 0(1890) Float License 1(70)
IR Expert Named License 0(1890) Float License 0(70)
Self Service Ticketing 0(Unlimited)
Service Catalog Named License 0(70070) Float License 0(0)
RAD Compiler Named License 0(0) Float License 0(0)