How to Automate Freshservice ITSM (Asset Lifecycle, KB Updates, Ticket Workflows — No API Required)

Mar 5

Introduction

Freshservice is used for ITSM, asset management, knowledge base, and ticketing. While Freshservice offers a REST API, browser automation provides a powerful solution for asset lifecycle, KB updates, and ticket workflows when API access is limited or when teams rely on the Freshservice web UI.

Why Use Browser Automation for Freshservice?

  • Limited API Access: API scope and rate limits can restrict bulk or UI-only workflows
  • Asset Lifecycle: Create, update, retire assets and run lifecycle workflows from the portal when API is restricted
  • KB Updates: Create and update knowledge base articles, categories, and approvals from the UI
  • Ticket Workflows: Create, assign, escalate, and close tickets; run SLA and workflow actions from the portal
  • UI-Only Features: Many asset and ticket views are easiest via the web interface
  • Cross-Module: Operate across Assets, Solutions (KB), and Tickets in one session
  • Audit: Export activity and ticket data for governance reviews

Setting Up Freshservice Automation

Here's how to automate asset lifecycle, KB updates, and ticket workflows in Freshservice using browser automation:



import { chromium } from 'playwright';

const response = await fetch("https://api.anchorbrowser.io/api/sessions", {
  method: "POST",
  headers: {
    "anchor-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    'headless': false,
    'proxy': { 'type': 'residential', 'country': 'US' }
  }),
});

const { id } = await response.json();
const connectionString = `wss://connect.anchorbrowser.io?apiKey=YOUR_API_KEY&sessionId=${id}`;

const browser = await chromium.connectOverCDP(connectionString);
const context = browser.contexts()[0];
const ai = context.serviceWorkers()[0];
const page = context.pages()[0];

await page.goto("https://your-domain.freshservice.com");

await ai.evaluate(JSON.stringify({
  prompt: 'Log in to Freshservice using the provided credentials. Complete SSO or 2FA if required and wait for the dashboard to load.'
}));



Use Case 1: Asset Lifecycle

Manage assets and run lifecycle workflows from the Freshservice UI:



const runAssetLifecycle = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.assetType
      ? `Navigate to Assets. Open list or form: ${criteria.assetType}.`
      : 'Navigate to Asset Management. Open the asset list.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'create'
      ? `Create new asset with fields: ${criteria.fields || 'as specified'}. Save.`
      : criteria.action === 'retire'
      ? `Retire or dispose asset(s) matching ${criteria.scope || 'selection'}. Confirm.`
      : 'List asset summary: name, asset tag, state, assigned to. Return as JSON array.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  const result = await ai.evaluate(JSON.stringify({
    prompt: 'Return summary: assets created/updated or current list. As JSON. No credentials.'
  }));
  
  return { result: typeof result === 'string' ? JSON.parse(result) : result, completedAt: new Date().toISOString() };
};



Use Case 2: KB Updates

Create and update knowledge base articles from the portal:



const runKbUpdates = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'create'
      ? 'Navigate to Solutions (Knowledge base). Create new article.'
      : 'Navigate to Solutions. Open category or article list.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'create'
      ? `Add article: title ${criteria.title || 'as specified'}, content, category. Save. Submit for approval if required.`
      : criteria.action === 'update'
      ? `Update article(s) matching ${criteria.scope || 'selection'}. Edit content. Save.`
      : 'List KB articles: title, category, status. Return as JSON array.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  const summary = await ai.evaluate(JSON.stringify({
    prompt: 'Return JSON: { processed: number, action: string }.'
  }));
  
  return { ...JSON.parse(summary), completedAt: new Date().toISOString() };
};



Use Case 3: Ticket Workflows

Create, assign, and process tickets from the UI:



const runTicketWorkflows = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'create'
      ? 'Navigate to Tickets. Create new ticket.'
      : 'Navigate to Tickets. Apply filter: status, agent, group.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'create'
      ? `Create ticket: subject, description, requester, group. Submit.`
      : criteria.action === 'assign'
      ? `Assign ticket(s) matching ${criteria.scope || 'selection'} to ${criteria.assignee || criteria.group || 'as specified'}.`
      : criteria.action === 'close'
      ? `Close or resolve ticket(s) matching ${criteria.scope || 'selection'}. Add note if required.`
      : 'List ticket summary: id, subject, status, assignee. Return as JSON array.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  const summary = await ai.evaluate(JSON.stringify({
    prompt: 'Return JSON: { processed: number, action: string }.'
  }));
  
  return { ...JSON.parse(summary), completedAt: new Date().toISOString() };
};



Exporting Activity and Audit Data

Pull ticket and audit data for compliance:



const exportFreshserviceActivity = async (page, ai, scope) => {
  await ai.evaluate(JSON.stringify({
    prompt: scope === 'audit'
      ? 'Navigate to Admin > Audit log. Set date range. Export or copy events.'
      : 'Navigate to Tickets or Reports. Export list or report. Wait for download if available.'
  }));
  
  const download = await page.waitForEvent('download', { timeout: 20000 }).catch(() => null);
  return download ? await download.path() : null;
};



Best Practices for Freshservice Automation

  • Security: Use least-privilege roles and SSO; never log credentials; respect Freshservice and data governance
  • Asset Lifecycle: Prefer API where available; use browser for one-off or UI-only updates; audit before bulk retire
  • KB Updates: Follow approval workflow; do not publish without review where required
  • Ticket Workflows: Do not auto-close without policy; use automation for assign and triage first
  • Rate Limits: Add delays between actions to stay within Freshservice limits
  • Error Handling: Retry on session timeout; handle SSO and 2FA gracefully
  • Compliance: Align automation with your org's ITSM policies

Handling Authentication

Freshservice supports SSO and 2FA where configured:



const handleFreshserviceAuth = async (page, ai, credentials) => {
  await page.goto("https://your-domain.freshservice.com");
  
  await ai.evaluate(JSON.stringify({
    prompt: 'Sign in with the provided credentials. If SSO is required, complete org SSO.'
  }));
  
  await ai.evaluate(JSON.stringify({
    prompt: 'If 2FA is required, enter code from app or device. Wait for Freshservice dashboard to load.'
  }));
  
  await page.waitForLoadState('networkidle');
};



Resources

Conclusion

Browser automation provides a flexible alternative to API access for Freshservice ITSM workflows. By using intelligent browser agents, you can automate asset lifecycle, KB updates, and ticket workflows directly from the Freshservice web UI. Whether you need to create and retire assets, update knowledge base articles, or create and assign tickets, browser automation enables efficient ITSM when API access is limited or when teams work in the portal.

Start automating your Freshservice asset lifecycle, KB updates, and ticket workflows today.

Other hubs

See all
No hubs found

Stay ahead in browser automation

We respect your inbox. Privacy policy

Welcome aboard! Thanks for signing up
Oops! Something went wrong while submitting the form.