Last login time of user to the backend vs portal

Howard Elton
Tera Contributor

I have a business requirement to record when an ITIL user last used the desktop/back of servicenow, and storing that information on the user record. I do not want to include portal logins/usage however, so the existing last_login & last_login_time is not suitable, since it get updated when a person logs into either the portal or the back end.  Other information: We are using MultiSSO (Azure) and then new Next experience UI in the back end.

 

Does anyone know neat a way to do this?

2 REPLIES 2

ersureshbe
Giga Sage
Giga Sage

Hi, I can see your user profile tagged the role determines the access in portal or platform. You should create a new field in user table to define the last login under portal or platform. Write a script -business rule to set the value as platform or portal using roles and last login time.

Regards,
Suresh.

ersureshbe
Giga Sage
Giga Sage

Hi, Adding additional point - 

gs.action.getGlideURI().toString().startsWith('api/now/sp') ==> will return true or false (true means it's running from Service Portal) With this solution you're independent from the URL and from the Service Portal which is loading (you could probably have multiple Service Portals).

Regards,
Suresh.