IBM Support

How to access user information from an ICM page script

Technical Blog Post


Abstract

How to access user information from an ICM page script

Body

Using the current user id, name, or role is a great way to provide more user centric information to you case workers. In IBM Case Manager 5.2 and it new client side scripting model, here's how you get that information.

  • Add a script adapter widget to the Cases solution page
  • Wire its incoming event to a custom event action button added to the toolbar of one of the page widgets
var userName = ecm.model.desktop.userDisplayName;
var userId = ecm.model.desktop.userId;
var role = ecm.model.desktop.currentRole.name;

var messageDialog = new ecm.widget.dialog.MessageDialog({
    text: "<b>Role</b>: " + role + " - " + userName + " - " + userId
});
messageDialog.show();

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11281250