How Servicenow trigger the Last Login Time event

Muhammad Arif B
Tera Contributor

There is OOB Script Action Last Login time under login event to capture user login timestamp. Do anyone know where login event is triggered? Reason is need to check what is conditions or rules to trigger login event.

MuhammadArifB_0-1722838219632.png

 

1 REPLY 1

Rajesh Chopade1
Mega Sage

Hi @Muhammad Arif B 

 

The conditions and rules for this event are built into the core platform processes. By exploring the Event Registry, relevant Business Rules, and Script Actions, you can gain a better understanding of how and when this event is triggered.

 

Here's how you can investigate and understand the conditions under which the "login" event is triggered:

  1. Event Registry:
    • Go to System Policy > Events > Event Registry.
    • Search for and open the "login" event.
    • Review the details to understand how it is defined and where it might be used.
  2. Business Rules:
    • Go to System Definition > Business Rules.
    • Look for any business rules related to user login, such as UserLogin.
    • Check if these business rules include logic to trigger the "login" event using the gs.eventQueue method.
  3. Example Script to Trigger an Event:
    • In some cases, custom scripts or business rules might use the gs.eventQueue method to trigger events.

Script Action for Last Login Time

To see the specific Script Action that captures the last login time:

  1. Script Actions:
    • Go to System Policy > Events > Script Actions.
    • Search for the Script Action related to the "login" event, such as "Last Login time".
    • Review the script to see how it updates the last login time.

i hope my answer helps you to resolve your issue if yes, mark my answer helpful & correct.

THANK YOU

rajesh chopade