ServiceNow example
Important
Any references to third-party products or services do not constitute Celonis Product Documentation nor do they create any contractual obligations. This material is for informational purposes only and is subject to change without notice. Celonis does not warrant the availability, accuracy, reliability, completeness, or usefulness of any information regarding the subject of third-party services or systems.
We will build an event log using raw data from ServiceNow. This event log will have data of the process "Incident Management".
What do we need?
To extract from ServiceNow our Incident table.
Sample file to download: incident.csv.
you can create your own sample files here:
A way to manipulate data. We recommend JupyterLab - click here.
Let's build the event log step-by-step
Step 1: Upload the file (if you are using JupyterLab locally you can skip this step)
Click the button bellow and upload your incident.csv file
![]() |
Step 2: Launch a Python3 notebook
Click the + button at the top left side and then select Python 3.
![]() |
Step 3: Paste the content of the script on the right side and then click the Play button
![]() |
Step 4: Download the generated Event Log
![]() |
You can download the event log from our library.
Step 5: Upload you event log in Celonis and start analyzing your process.
Event Log Generator for ServiceNow
import pandas as pd import os import datetime #let's create our event log #step1: create the structure of our event log eventlog = pd.DataFrame(columns = ['CaseID','Activity','Timestamp','Created_by','Closed_by','Escalation','State','Priority','Urgency','Category','Contact_type','Short_description']) #step2: read incident file incident =pd.read_csv(os.getcwd()+"/"+"incident.csv") #step3: fill the eventlog with data for index, row in incident.iterrows(): new_row = { 'Created_by' :row['sys_created_by'], 'Closed_by' :row['closed_by'], 'Escalation' :row['escalation'], 'State' :row['state'], 'Priority' :row['priority'], 'Urgency' :row['urgency'], 'Category' :row['category'], 'Contact_type' :row['contact_type'], 'Short_description' :row['short_description'] } #activity: Ticket created if not pd.isna(row['sys_created_on']) and not pd.isna(row['number']): cat = { 'CaseID' :row['number'], 'Activity' :'Ticket created', #we add the activity 'Timestamp' :row['sys_created_on'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #activity: Ticket opened if not pd.isna(row['opened_at']) and row['opened_at'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket opened', #we add the activity 'Timestamp' :row['opened_at'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #activity: Ticket activity due if not pd.isna(row['activity_due']) and row['activity_due'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket activity due', #we add the activity 'Timestamp' :row['activity_due'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #activity: Ticket due date if not pd.isna(row['due_date']) and row['due_date'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket due date', #we add the activity 'Timestamp' :row['due_date'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #Activity: Ticket SLA due if not pd.isna(row['sla_due']) and row['sla_due'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket SLA due', #we add the activity 'Timestamp' :row['sla_due'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #Activity: Ticket resolved if not pd.isna(row['resolved_at']) and row['resolved_at'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket resolved', #we add the activity 'Timestamp' :row['resolved_at'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #Activity: Ticket re-opened if not pd.isna(row['reopened_time']) and row['reopened_time'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket re-opened', #we add the activity 'Timestamp' :row['reopened_time'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) #Activity: Ticket closed if not pd.isna(row['closed_at']) and row['closed_at'] != '' and not pd.isna(row['number']) and row['number'] != '': cat = { 'CaseID' :row['number'], 'Activity' :'Ticket closed', #we add the activity 'Timestamp' :row['closed_at'], #and corresponding the timestamp } new_row.update(cat) eventlog = eventlog.append(new_row, ignore_index=True) eventlog = eventlog.reset_index(drop=True) eventlog.to_csv(os.getcwd()+"/"+"eventlog.csv", index=False)