Create generic change request

This endpoint allows you to create a new generic change request.

Tip: Use generic ticket APIs to document change request tickets for devices for unique business needs which are not addressed within existing FireFlow workflows.

The request body is in JSON format and consists of the template and custom fields. Custom fields can be either mandatory and optional.

Important: To use this API, you must disable Create Change request from file in the FireFlow UI for each generic template you want to use.

To do this:

  1. Open FireFlow

  2. Select Request Templates

  3. Select Generic template

  4. set Create Change request from file to No

You can also define attachments using a custom field. To upload multiple attachments (in xslx, text, csv, etc.) use this JSON format, for example:

{
  "template": "generic-based",
  "fields": [
    {
      "name": "attachments",
      "values": [
        "filename=attachment1.log:content=ZmlyZWZsb3cgLm=",
        "filename=attachment2.log:content=skjdfhbdZssddm="
             ]
    }
  ]
}

Note: To define attachments, the name field value must be “attachments”. The values must consist of filename=<filename>:content=<file content>. Content consists of the file contents translated to base64 format.

Resource Name: /change-requests/generic/

Request Method: POST

Header requirements:

Key Value
Cookie FireFlow_Session=[sessionId]. The sessionId is retrieved from the authentication request.

Request body parameters:

  Element Type Description

template

mandatory

String

The name of the change request template to use.

fields

optional or mandatory

Array of custom fields
  name String

The name of a custom field in the Change Request.

For example, enter Owner to set the value of the Owner field in the Change Request.

  values String

The value of the named field.

For example, if you are defining the Owner field, enter a username or email address.

Response:

Code

Description

200

Operation completed successfully

400

Input validation failure

403

Authentication failure

500

Failed to complete operation.

cURL request example

curl -X POST "https://<localhost>/FireFlow/api/change-requests/generic" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"template\": \"generic-based\", \"fields\": [ { \"name\": \"subject\", \"values\": [ \"Enable traffic in device\" ] } ]}"

Sample request

{
  "template": "generic",
  "fields": [
    {
      "name": "Subject",
      "values": [
        "Enable traffic in device"
      ]
    }
  ]
}

Sample response (success)

  {
  "status": "Success",
  "messages": [],
  "data": {
    "changeRequestId": 6749,
    "redirectUrl": "https://../FireFlow/Ticket/Display.html?id=6749"
  }
}

Sample response (Failure)

 {
   "status": "Failure",
   "messages": [{
      "code": "FLOW_NOT_SUPPORTED",
      "message": "Create generic ticket is not supported for requests from file"
   }],
   "data": null
}

Sample response (Failure)

 {
  "status": "Failure",
  "messages": [
    {
      "code": "INVALID_FORM_TYPE",
      "message": "Invalid template form type, form type should be: Generic Change"
    }
  ],
  "data": null
}