Update Remediation Ticket Details

Use this API to update
Control Compliance Suite
remediation ticket details.
You can update any of or all the following details in an input request for a single ticket at a time:
  • Ticket state (from 1 to 5)
  • Description
  • Ticket priority
  • Details of user to whom the ticket is assigned for remediation
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 Update Remediation Ticket Details API.
You must have permission on the standard and the assets that are mentioned in the ticket to use the Update Remediation Ticket Details API.
  Request method for Update Remediation Ticket Details API
To update remediation ticket details, create a
PATCH
request.
HTTPS request components for Update Remediation Ticket Details API
Create a PATCH request by using the following components:
HTTPS request components for Update Remediation Ticket Details API
Request component
Value
URL
https://<hostname>:<port number>/ccs/api/v1/RemediationTickets/
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
JSON Body
{"TicketNumber":<ticket_number>, "TicketState":<ticket_state>, "TicketDescription": <Ticket_Description>, "Priority":<Ticket_Priority>, "AssignedTo":<user ID or email ID or user name>}
HTTPS request parameters for Update Remediation Ticket Details API
The following table contains the description of the HTTPS request parameters for the Update Remediation Ticket Details API. You can update all or any of these parameters to update the ticket details.
HTTPS request parameters or Update Remediation Ticket Details API
Field name
Field type
Data type
Description
TicketNumber
Optional
String
This is the ticket number which is displayed in the
Ticket Number
column in the Remediation workspace.
TicketState
Optional
Integer
This is the number that denotes state of the ticket. Each integer value of this parameter represents a ticket status.
TicketDescription
Optional
String
This is the ticket description.
Priority
Mandatory
Integer
You can set the ticket priority level.
AssignedTo
Optional
String
This is the user ID, email ID, or user name of the user to whom the ticket is assigned for remediation.
Control Compliance Suite
ticket statuses
You can update the status of a
Control Compliance Suite
remediation ticket by updating the value of the TicketState parameter in an input request. The ticket states and the corresponding statuses that they represent are listed in the following table:
State
Status
1
Open
2
Remediation Performed
3
Verified
4
Failed
5
Not Applicable
Control Compliance Suite
processes remediation tickets only for the ticket statuses that are mentioned in this table.
The Remediation Verification job is run only after you update the ticket state to 2, which means
Remediation Performed
.
  Response body for Update Remediation Ticket Details API
The PATCH request for the Update Remediation Ticket Details API returns the response body in the following structure:
204 (No content)
Sample HTTPS request for Update Remediation Ticket Details API
The following is a sample HTTPS request for your reference.
Sample HTTPS request for Update Remediation Ticket Details API
Request component
Value
URL
https://<hostname>:<port number>/ccs/api/v1/RemediationTickets/
You can also use the Fully Qualified Domain Name (FQDN) as the hostname. You can configure the port number in the configuration file of the Application Server by adding the
REST_API_PORT
key. If you do not configure the port, the default port is considered in the request. The default port is 12431.
Content type
application/json
JSON Body
{"TicketNumber":"INCA0000009", "TicketState":"2", "ticketDescription":"Description text", "Priority":"Medium", "AssignedTo":"example domain\sysadmin"}
  Sample HTTPS response for Update Remediation Ticket Details API
204 (No content)
HTTPS response codes for Update Remediation Ticket Details API
Depending on the success or the failure of your API request, you see the following response codes for the Update Remediation Ticket Details API:
HTTPS response codes for Update Remediation Ticket Details API
Response Code
Response Type
Description
204
No content
Remediation ticket details are updated successfully. However, there is no content to return.
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 one of the following reasons:
400
Bad Request
(Client Error)
This may be because of one of the following reasons:
  • If input request contains an invalid ticket number, the following error message is displayed:
    Ticket number is invalid or empty.
  • If input request contains an invalid ticket state, the following error message is displayed:
    Provide valid ticket state.
  • If input request contains no ticket details to update, the following error message is displayed:
    Provide ticket details to update.
  • If input request contains invalid ticket details, the following error message is displayed:
    Provide valid ticket details.
404
Not found
The following error message is displayed:
Ticket not found. Provide valid ticket number.
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 Update Remediation Ticket Details API
Click to view a sample Python script for Update Remediation Ticket Details API
# Script to update ticket details based on provided ticket ID 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 valid ticket details that need to be updated # User can update ticket description, ticket priority, ticket assignment and ticket status payload = " {\"TicketNumber\":\"INCA0000001\",\"ticketDescription\":\"Description updated\",\"Priority\":\"Low\",\"AssignedTo\":\"AzadRai\", \"TicketState\":\"4\"}" requests.packages.urllib3.disable_warnings(InsecureRequestWarning) bearertoken = "Bearer " + getToken() headers = { 'Authorization': bearertoken , 'Content-Type': "application/json" } response = requests.request("PATCH", url, data=payload, headers=headers, verify=False) print(response.text) print(response.json)