PowerShell module that utilises the Freshservice API

I posted this in the Community forum, and @Zach suggested I post it here too…

I’ve started work on a PowerShell module to utilise the Freshservice API to manage tickets. I intend to add more functionality when I can, but at the moment it will work with the APIs concerned with tickets, conversations, requesters, agents, groups, service catalog items, custom objects, locations and departments.

If you’d like to take a look, it’s available on GIthub here: GitHub - LesNewbigging/FreshAPIv2: A PowerShell module containing functions that invoke the Fresh v2 APIs

Feel free to use it and adapt it to your own requirements.

Comments and suggestions are welcome.

3 Likes

Hey Les. I am working on a Powershell Module for Freshservice as well but haven’t posted yet. We could probably combine forces to put together a well tested module. Here are the functions developed:

Add-FreshServiceRequesterGroupMember
Get-FreshServiceAgent
Get-FreshServiceAgentGroup
Get-FreshServiceAgentRole
Get-FreshServiceAsset
Get-FreshServiceAssetRelationshipType
Get-FreshServiceAssetType
Get-FreshServiceBusinessHour
Get-FreshServiceCatalogCategory
Get-FreshServiceCatalogItem
Get-FreshServiceContract
Get-FreshServiceDepartment
Get-FreshServiceForm
Get-FreshServiceLocation
Get-FreshServiceOnboardingRequest
Get-FreshServiceProduct
Get-FreshServiceProject
Get-FreshServicePurchaseOrder
Get-FreshServiceRequester
Get-FreshServiceRequesterGroup
Get-FreshServiceRequesterGroupMember
Get-FreshServiceSoftware
Get-FreshServiceSoftwareUser
Get-FreshServiceTask
Get-FreshServiceTicket
Get-FreshServiceTicketConversation
Get-FreshServiceVendor
New-FreshServiceAgent
New-FreshServiceAgentGroup
New-FreshServiceAgentRoleConfig
New-FreshServiceAsset
New-FreshServiceAssetType
New-FreshServiceContract
New-FreshServiceDepartment
New-FreshServiceLocation
New-FreshServiceProduct
New-FreshServiceProject
New-FreshServicePurchaseOrder
New-FreshServiceRequesterGroup
New-FreshServiceRequestor
New-FreshServiceSoftware
New-FreshServiceSoftwareUser
New-FreshServiceTask
New-FreshServiceTicket
New-FreshServiceTicketNote
New-FreshServiceVendor
Remove-FreshServiceAgentGroup
Remove-FreshServiceAsset
Remove-FreshServiceAssetType
Remove-FreshServiceDepartment
Remove-FreshServiceLocation
Remove-FreshServiceProduct
Remove-FreshServiceProject
Remove-FreshServicePurchaseOrder
Remove-FreshServiceRequester
Remove-FreshServiceRequesterGroupMember
Remove-FreshServiceSoftware
Remove-FreshServiceSoftwareUser
Remove-FreshServiceTicket
Remove-FreshServiceVendor
Restore-FreshServiceAsset
Set-FreshServiceAgentGroup
Set-FreshServiceAsset
Set-FreshServiceAssetType
Set-FreshServiceConnectionSettings
Set-FreshServiceContract
Set-FreshServiceDepartment
Set-FreshServiceLocation
Set-FreshServiceProduct
Set-FreshServiceProject
Set-FreshServicePurchaseOrder
Set-FreshServiceRequesterGroup
Set-FreshServiceRequestor
Set-FreshServiceSoftware
Set-FreshServiceSoftwareUser
Set-FreshServiceTicket
Set-FreshServiceTicketTask
Set-FreshServiceVendor

Let me know if you would like to collaborate and would like to publish to Powershell Gallery for Community consumption.

1 Like

Hello Rob

That sounds great!

I concentraed on getting it working with tickets first, adding in requesters, agents, groups, service catalog items and custom objects - but I see you’ve also covered areas I haven’t got to yet!

If you look at mine on Github, I’ve broken down the various modules into their own nested modules:

  • FreshAPI.CustomObjects.psm1
  • FreshAPI.Departments.psm1
  • FreshAPI.Locations.psm1
  • FreshAPI.Requesters.psm1
  • FreshAPI.ServiceCatalog.psm1
  • FreshAPI.Tickets.psm1

These mainly follow Fresh’s API documentation, though the requesters module also includes agents, roles and groups, whilst tickets also includes conversations.

The FreshAPIv2.psm1 module contains functions that make the GET/POST/PUT/DELETE calls to the API, with some error handling (e.g. waiting before resubmitting a 429 request), along with some other supporting functions.

Take a look and let me know what your thoughts are.

Les

I am really liking this Module. We use it to update User objects in Freshservice to match users to their location. When will you get a chance to add the Asset management. I could really use that feature to manage assets. looking forward to see more modules.

Thanks Perry

I’m glad you’re finding it useful!

If I remember righthly, assets also involves products, and therefore vendors, and a few other bits. We’re you looking for software, contracts and purchase orders too?

I’m not sure when I can get them done, but intend to spend some time on it soon.

L

Thanks for the reply,

I am just looking at managing assets at the moment.
That’s the immediate need so i can build a lifecycle for assets.

Still chipping away at my module and hope to have it ready for release shortly and will update this thread. With Workspaces coming out, there will be changes to the APIs as well, so waiting for the documentation to be updated.