Skip to main content
New Idea

Last Login Date or Days Since Last Logon Needed for API

Related products:Freshservice
  • April 9, 2024
  • 3 replies
  • 89 views

mbutler
Top Contributor ⭐
Forum|alt.badge.img+10

We are implementing the CIS Critical Controls within our environment – one of the aspects of that which we need to consider is FreshService.

For our agents, we utilize SSo to control the aspect of agent logins – however, for requesters/contacts, they simply use a FreshService username/password that they have registered with.

One of the CIS Critical Controls is to disable/delete accounts where 45 days of inactivity have occurred. However, after pulling a requester record from the API, I noticed that are zero fields associated with the last login or “Days since last login”. Instead, you only get the creation date/time and the last update date/time.

Is there a way to also add “Last Login” to the output of the requester API call?

"requester": {
"active": true,
"address": null,
"background_information": null,
"can_see_all_changes_from_associated_departments": false,
"can_see_all_tickets_from_associated_departments": false,
"created_at": "2024-04-09T12:45:59Z",
"custom_fields": {
"alternate_phone": null,
"fax": null,
"notes": null,
"alerts": null,
"active": null
},
"department_ids": [],
"department_names": null,
"external_id": null,
"first_name": "John",
"has_logged_in": true,
"id": ######86458,
"is_agent": false,
"job_title": null,
"language": "en",
"last_name": "Doe",
"location_id": null,
"location_name": null,
"mobile_phone_number": null,
"primary_email": "John.Doe@SomeCompany.com",
"reporting_manager_id": null,
"secondary_emails": [],
"time_format": "24h",
"time_zone": "Eastern Time (US & Canada)",
"updated_at": "2024-04-09T12:52:45Z",
"vip_user": false,
"work_phone_number": null,
"work_schedule_id": null
}
}

 

3 replies

mbutler
Top Contributor ⭐
Forum|alt.badge.img+10
  • Author
  • Top Contributor ⭐
  • April 9, 2024

@Ammar KB is this something that is captured internally but not exposed via the API?


Medic1334
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • January 7, 2025

@Ammar KB is this something that is captured internally but not exposed via the API?

Doing this for requesters would be tough as if a requester emails in, their ticket is created and therefore they have never “logged in” to the portal despite the fact they may have created dozens of tickets recently. I dont see it anywhere in the UI either. 

Additionally, I wonder if deactivated requesters would be able to raise tickets if there was some sort of way to deactivate them as you are looking for (this could prevent you from receiving tickets from clients who you may not hear from for months).

Agents do have the last login attribute, so you would be able to easily do this but I would say given the above example (and others) I’m sure you could articulate out to an auditor/compliance and at least perform the agent side.


mbutler
Top Contributor ⭐
Forum|alt.badge.img+10
  • Author
  • Top Contributor ⭐
  • January 7, 2025

@Ammar KB is this something that is captured internally but not exposed via the API?

Doing this for requesters would be tough as if a requester emails in, their ticket is created and therefore they have never “logged in” to the portal despite the fact they may have created dozens of tickets recently. I dont see it anywhere in the UI either. 

Additionally, I wonder if deactivated requesters would be able to raise tickets if there was some sort of way to deactivate them as you are looking for (this could prevent you from receiving tickets from clients who you may not hear from for months).

Agents do have the last login attribute, so you would be able to easily do this but I would say given the above example (and others) I’m sure you could articulate out to an auditor/compliance and at least perform the agent side.

Thanks - I did test this. If a contact is deactivated, they can still raise a ticket, but it ends up in Spam. This isn’t a preferred method of course.

Right now, I created two fields for contacts called “Last Active Date” and “Active”. I have a workflow that checks when tickets are updated or created - when that happens, I’m updating the “Last Active Date” to the current date and Active to true.

This gives me a starting point to help implement the critical control - I’m going to have to have a bucket - maybe a “Deactivated” organization (MSP Mode) and put them in that bucket. That way, the ticket doesn’t go to spam and the ticket still gets raised.

I’m still wrapping my head around it - but I need a way to implement this critical control and just trying to use the tools available to me to do it.