How to use pipeline action: Evaluate JavaScript for accessing Solarwinds Tickets?

Overview

In pipeline action - Evaluate JavaScript following methods are available to access Solarwinds ticketing API calls

Chime V5 Solarwinds Features

To use Solarwinds integration enable following features

ChimeV5.Ticketing.Solarwinds

Script Method - getSolarwindsTickets('seekerEmailAddress')

To get list of tickets, script call will appear as follows:

//Get tickets
var tickets = getSolarwindsTickets("${Guest.Email}");

In response method will return list of tickets JSON

[
  {
    "Seeker": "0007002",
    "Agent": "0007003",
    "Question": "Employee payroll application server is down.",
    "ChatTranscript": "",
    "Id": "f12ca184735123002728660c4cf6a7ef",
    "Number": "0007001",
    "URL": "https://solarwindssoftwareasiapte.samanage.com/0007001",
    "UpdatedOn": "2023-06-07 12:24:46",
    "TicketState": "New"
  },
  {
    "Seeker": "0007002",
    "Agent": "0007003",
    "Question": "Performance problems with wifi",
    "ChatTranscript": "",
    "Id": "78271e1347c12200e0ef563dbb9a7109",
    "Number": "0000057",
    "URL": "https://solarwindssoftwareasiapte.samanage.com/0000057",
    "UpdatedOn": "2023-05-29 13:20:52",
    "TicketState": "New"
  }
]

JSON response can be converted into an array

var ticketsArray = JSON.parse(tickets);

//Array allows you to get count and loop through ticket records etc...
sendReply("Count of tickets: " + ticketsArray.length);

Script Methods

createSolarwindsTicket(seekerEmailAddress, agentEmailAddress, title, description)

updateSolarwindsTicketDescription(ticketId, updatedDescription)

assignSolarwindsTicket(ticketId, agentEmailAddress)

JavaScript Solarwinds helper calls allow creation and updating of ticket.

//API call to create ticket
var result = createSolarwindsTicket('seeker@domain', 'agent@domain', 'Request for new laptop', 'Current laptop has reached end of life');

//API call to update description
var result = updateSolarwindsTicketDescription('00070', 'Please engage network team');

//API call to assign ticket
var result = assignSolarwindsTicket('00070', 'agent@domain');

var ticket = JSON.parse(result);

//Access ticket properties etc...
sendReply("Ticket Id " + ticket.Id);

API call will return updated ticket record.

Related Items

API, javascript, tickets, ITSM, Ticketing, solarwinds
vgarg