November 23, 2017

List tickets.

The script retrieves all the tickets in a brand account.
It displays the same result like in

Important manual pages

Author: SoftLayer Technologies, Inc. <>

import SoftLayer.API
import json

USERNAME = 'set me'
API_KEY = 'set me'

brandId = 4

client = SoftLayer.create_client_from_env(username=USERNAME, api_key=API_KEY, timeout=500)
brandService = client['SoftLayer_Brand']

objectMask = "mask[group[name], status[name], statusId, id, createDate, title, assignedUser[username], attachedFileCount, totalUpdateCount, modifyDate, lastEditType, newUpdatesFlag, attachedHardwareCount, attachedVirtualGuestCount, priority, account[companyName, accountStatus[name]], assignedAgents[username], state[stateType], scheduledActions[transactionGroup, ticketScheduledActionReference] ]"
objectFilter = {"tickets": {"status": {"name": {"operation": "in", "options":  [{"name": "data", "value": ["Open", "Assigned"]}]}}}}

    result = brandService.getTickets(id=brandId, filter=objectFilter, mask=objectMask)
    print(json.dumps(result, sort_keys=True, indent=2, separators=(',', ': ')))
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to list the tickets. "
          % (e.faultCode, e.faultString))


We would love to hear it
Open an issue