Search Remediation Tickets

Use this API to retrieve the list of remediation tickets in
Control Compliance Suite
(CCS) 12.5.
Authentication
To grant access to users to view or execute
Control Compliance Suite
RESTful APIs, you must generate an authentication token.
Authorization requirements
You must be in the Remediation Administrator role to use the Search Remediation Tickets API.
You must have https://help.symantec.com/cs/CCS12.0/CCS12_0/v122981946_v120691527/Configuring-roles-and-permissions?locale=EN_US on the standard and the assets that are mentioned in the ticket to use the Search Remediation Tickets API:
  Request method
To retrieve the list of
Control Compliance Suite
assets in your environment, create a
GET
request.
  HTTPS request components for Search Remediation Tickets API
Create a GET request by using the following components:
HTTPS request components for Search Remediation Tickets API
Request component
Value
URL
https://<hostname>:<port number>/ccs/api/v1/ RemediationTickets?Fields=(FieldName1 OP value1, FieldName2 OP value2, FieldNameN OP valueN) & Page=X & PageSize=Y
You can also use the Fully Qualified Domain Name (FQDN) as the hostname. You can configure the port number from the
Integration Services Endpoint Configuration
dialog box from
Settings
>
Deployment View
on the
Control Compliance Suite
console. You must restart the Symantec Application Server Service after you configure the port. If you do not configure the port, the default port is considered in the request. The default port is 12431.
Content type
application/json
  HTTPS request parameters for Search Remediation Tickets API
The following table contains the description of the HTTPS request parameters for the Search Remediation Tickets API:
HTTPS request parameters for Search Remediation Tickets API
Field name
Field type
Data type
Description
Fields
Mandatory
String
This is a comma-separated list of ticket fields and their respective values that are joined by an operator. The ‘OP’ placeholder in the HTTPS request components for Search Remediation Tickets API section indicates the '=' query operator.
See the
Remediation Ticket Fields
table.
Comma in the list of field names is treated as 'AND'.
The
Search Remediation Tickets
API returns a list of remediation tickets along with their total count.
Page
Optional
Integer
Considering that the Search Remediation Tickets API can return huge data depending on the number of tickets in your system, pagination support is added. By using the
Page
parameter, you can specify the page number to retrieve in response to the API call. The default value of this parameter is 0.
PageSize
Optional
Integer
By using this parameter, you can decide how many result entries should be displayed on a single page. The default value of this parameter is 1000.
You can use all or any of the following remediation ticket fields in input request:
Remediation Ticket Fields
Remediation Ticket Fields
Field
Data type
Description
TicketNumber
String
This is the ticket number which is displayed in the
Ticket Number
column in the Remediation workspace.
TicketID
GUID
This is the unique identifier of a remediation ticket. You can obtain this ID by using the Get Remediation Ticket Details by Ticket Number API.
CreatedBy
String
This is the user name of user who creates the ticket.
JobID
GUID
This is the unique identifier of the job from which the ticket is created.
AssignedTo
String
These are the details of user to whom the ticket is assigned for remediation.
CreatedOn
String
This is the date when the ticket is created. Use any of the following date formats in input request:
  • DD/MM/YYYY
  • DD-MM-YYYY
If you use this parameter, remediation tickets that are created only on the specified date are returned in response.
CreatedDateStarts
String
Use the
CreatedDateStarts
parameter to get the list of tickets that are created on and after the specified date.
The permissible date formats are same as the
CreatedOn
parameter.
CreatedDateEnds
String
Use the
CreatedDateEnds
parameter to get the list of tickets that are created on and before the specified date.
The permissible date formats are same as the
CreatedOn
parameter.
ModifiedOn
String
This is the date when the ticket is modified. The permissible date formats are same as the
CreatedOn
parameter.
ModifiedDateStarts
String
Use the
ModifiedDateStarts
parameter to get the list of tickets that are modified on and after the specified date.
The permissible date formats are same as the
CreatedOn
parameter.
ModifiedDateEnds
String
Use the
ModifiedDateEnds
parameter to get the list of tickets that are modified on and before the specified date.
The permissible date formats are same as the
CreatedOn
parameter.
Priority
String
This is the priority that is set by the user.
TicketState
Integer
This is the number that denotes state of the ticket. Each integer value of this parameter represents a ticket status.
TicketUrgency
Integer
This is the number that denotes urgency of the ticket.
TicketProviderType
Integer
This is the number that denotes the remediation ticket type. One denotes ServiceNow ticket; whereas two denotes
Control Compliance Suite
ticket.
  Response body for Search Remediation Tickets API
The GET request for the Search Remediation Tickets API returns the response body in the following structure:
Success Response: { "TotalCount": Int, "TotalPages": Int, "PrevPageUrl": String, "NextPageUrl":String, "TicketList": [ { "TicketNumber": String "TicketID": String "CreatedBy": Domain\User Name "JobID":String "AssignedTo":String "CreatedOn": Date(DD/MM/YYYY OR DD-MM-YYYY) "CreatedDateStarts":Date(DD/MM/YYYY OR DD-MM-YYYY) "CreatedDateEnds":Date(DD/MM/YYYY OR DD-MM-YYYY) "ModifiedOn":Date(DD/MM/YYYY OR DD-MM-YYYY) "ModifiedDateStarts":Date(DD/MM/YYYY OR DD-MM-YYYY) "ModifiedDateEnds":Date(DD/MM/YYYY OR DD-MM-YYYY) "Priority ":String "TicketImpact"" Int "TicketState": Int "TicketUrgency ": Int "TicketProviderType ": Int } ] }
Sample HTTPS request for Search Remediation Tickets API
The following is a sample HTTPS request for your reference. We have used DisplayName as the attribute in the sample:
HTTPS request components for Search Remediation Tickets API
Request component
Value
URL
https://<hostname>:<port number>/ccs/api/v1/ RemediationTickets?fields=fields=(TicketState=1,TicketProviderType=2)&page=0&pagesize=2
Content type
application/json
  Sample HTTPS response for Search Remediation Tickets API
The sample HTTPS request that you created earlier returns the following response:
{ "TotalCount":4, "TotalPages":2, "PrevPageUrl":"", "NextPageUrl":"https://<host name>:<port number>/ccs/api/v1/remediationtickets?Fields=%28TicketState%3D1%2CTicketProviderType%3D2%29&page=1&pagesize=2", "TicketList":[{"TicketNumber":"INCA0000003","TicketID":"2e1fba4d-3d76-42ba-9fc4-52c4a1923b56", "CreatedBy":"<domian name>\\<user name>", "JobID":"1f0ee8cb-d843-48a6-b7b1-f36f0c4e658d", "AssignedTo":"","CreatedOn":"2018-11-23T08:43:17.913","ModifiedOn":"2018-11-23T08:43:17.913", "Priority":"Moderate","Status":"Open","TicketImpact":2,"TicketState":1,"TicketUrgency":2, "TicketProviderType":2}, {"TicketNumber":"INCA0000004","TicketID":"72e644c9-1a3b-465d-8119-c268b56ca474", "CreatedBy":"<domian name>\\<user name>", "JobID":"1f0ee8cb-d843-48a6-b7b1-f36f0c4e658d", "AssignedTo":"","CreatedOn":"2018-11-23T08:43:19.85","ModifiedOn":"2018-11-23T08:43:19.85", "Priority":"Moderate","Status":"Open","TicketImpact":2,"TicketState":1,"TicketUrgency":2, "TicketProviderType":2}] }
HTTPS response codes for Search Remediation Tickets API
Depending on the success or the failure of your API request, you see the following response codes for the Search Remediation Tickets API:
HTTPS response codes for Search Remediation Tickets API
Response Code
Response Type
Description
200
OK
The list of remediation tickets is available with the following asset details:
  • Total count of tickets
  • Total pages
  • Previous page URL
  • Next page URL
  • Ticket details
    Ticket details include the following information:
    • Display number
    • Ticket GUID
    • User who creates the ticket
    • Unique identifier of the job from which the ticket is created
    • User to whom the ticket is assigned for remediation
    • Dates when the ticket is created and modified
    • Ticket priority
    • Ticket status
    • Ticket impact
    • Ticket state
    • Ticket urgency
    • Ticket type (ServiceNow or
      Control Compliance Suite
      )
200
(with Total Count: 0 in response body)
OK
The request is completed successfully. However, there are no records matching the request parameters. In this case, the following response is returned. The total count of tickets in this case is zero:
{ "TotalCount": 0, "TotalPages": 0, "PrevPageUrl": "", "NextPageUrl": "", "TicketList": [] }
403
Forbidden
The following error message is displayed:
You are not authorized to perform this task. Access is denied.
401
Unauthorized
This may be because of an invalid access token or an expired access token in an API request.
400
Bad Request
(Client Error)
The following error message is displayed:
Server could not understand the request due to invalid syntax. Please check requested URL.
500
Internal Server Error
(Server Error)
The following error message is displayed:
Server encountered an error while serving request. Please contact administrator if problem persists.
Sample Python script for Search Remediation Tickets API
Click to view a sample Python script for Search Remediation Tickets API
# Script to find out all the remediation tickets based on Ticket State and Ticket provider type import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning # Variable # Replace the <hostname> with CCS application server host name # Replace the <port number> with the configured port number for REST API, Default Port Number : 12431 # Replace the <user name> and <password> with valid CCS user name and password for example: UserName = domain1\\administrator, password = <Base64 encoded> HostName = '<hostname>' PortNumber = '<port number>' UserName = '<user name>' Password = '<password>' #<Base64 encoded> # Function to generate CCS REST API access token def getToken(): urlToken = "https://" + HostName + ":" + PortNumber + "/ccs/api/v1/oauth/tokens" payload = "grant_type=password&username=" + UserName + "&password=" + Password +"" headers = { 'Content-Type': "application/json", } responseToken = requests.request("POST", urlToken, data=payload, headers=headers, verify=False) autheticationresult = responseToken.status_code if (autheticationresult!=200) : print("\nToken Generation Failed. Please check if the REST API is enabled and User name and password is correct\n") exit() tokenDict = responseToken.json() token = tokenDict['access_token'] refreshToken = tokenDict['refresh_token'] print("bearer Token is:\n") print(token) print("\n Refresh Token is:\n") print(refreshToken) return token # Remediation Ticket URI url = "https://" + HostName + ":" + PortNumber + "/ccs/api/v1/RemediationTickets" # Provide the TicketState and TicketProviderType for searcing the ticket details querystring = {"Fields":"(TicketState=1,TicketProviderType=2)","page":"0","pagesize":"2"} requests.packages.urllib3.disable_warnings(InsecureRequestWarning) bearertoken = "Bearer " + getToken() headers = { 'Authorization': bearertoken , 'Content-Type': "application/json" } response = requests.request("GET", url, headers=headers, params=querystring, verify=False) print(response.text) print(response.json)