Fossil

JSON API: Tickets
Login

JSON API: Tickets

(⬑JSON API Index)

Jump to:


Tickets

This API is incomplete. It is missing at least the following features:

Ticket Reports

Fetch a Report

Status: implemented 20111008

Required privileges: "t" (the thinking being that only those permitted to create reports should be able to read their SQL code)

Request: /json/report/get[/REPORT_NUMBER]

Request options:

Response payload example:

{
"report":1,
"owner":"drh",
"title":"All Tickets",
"timestamp":"112443570187200",
"columns":"#ffffff Key:\r\n#f2dcdc Active\r\n...",
"sqlCode":"..."
}

List Reports

Status: implemented 20111008

Required privileges: "r" or "n"

Request: /json/report/list

Response payload example:

[
 {
  "report":1,
  "title":"All Tickets",
  "owner":"drh"
  },
  …
]

Run a Report

Status: implemented 20111008

Required privileges: "r" or "n"

Request: /json/report/run[/REPORT_NUMBER]

Request options:

Response payload example:

{
  "report":1,
  "title":"All Tickets",
  "sqlcode": "only set if requester has 't' privileges.",
  "columnNames":[ … list of column names … ],
  "tickets":[
    {
      "bgcolor":"#cfe8bd",
      "#":"fc825dcf52",
      "timestamp":"112443570187200",
      "type":"Code_Defect",
      "status":"Fixed",
      "subsystem":null,
      "title":"\"config pull all\" asks to approve ssl cert"
    },
    …
  ]
}

Note that the column names of ticket reports are determined by the reports themselves, and not C code. That means that we cannot return a standard set of column names here. Fossil requires certain column naming conventions for purposes of styling the HTML interface, e.g. the "#" column is always the uuid of the record and "bgcolor" (note the different casing than bgColor used throughout the rest of this API!) has a specific meaning to the HTML report browser. Fossil also allows the tickets to be extended with client-specified fields, so we cannot generically make these results fit into the API-wide naming scheme. Full details are here:

/doc/trunk/www/custom_ticket.wiki

and:

/rptsql?rn=1

(That one may require non-default permission.)