Get a list of custom field values
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/system/customfieldvalues
Example
Request
1use Ticketmatic\Endpoints\Settings\System\Customfieldvalues;
2
3$result = Customfieldvalues::getlist($client, array(
4 "typeid" => 10000,
5 "filter" => "select id from tm.customfieldvalues WHERE createdts > (now() - INTERVAL '30 days')",
6 "includearchived" => true,
7 "lastupdatesince" => "2014-09-26 15:24:36",
8));
9
10// The parameters array is optional, it can be omitted when empty.
11$result = Customfieldvalues::getlist($client);
Response
1object(Ticketmatic\Endpoints\Settings\System\CustomfieldvaluesList) (1) {
2 ["data"]=>
3 array(1) {
4 [0]=>
5 object(\Ticketmatic\Model\CustomFieldValue) (7) {
6 ["id"]=>
7 int(0)
8 ["typeid"]=>
9 int(0)
10 ["caption"]=>
11 string(4) "Rock"
12 ["sortorder"]=>
13 int(0)
14 ["isarchived"]=>
15 bool(false)
16 ["createdts"]=>
17 object(\DateTime) (3) {
18 ["date"]=>
19 string(26) "2014-09-26 15:24:36.000000"
20 ["timezone_type"]=>
21 int(3)
22 ["timezone"]=>
23 string(3) "UTC"
24 }
25 ["lastupdatets"]=>
26 object(\DateTime) (3) {
27 ["date"]=>
28 string(26) "2014-09-26 15:24:36.000000"
29 ["timezone_type"]=>
30 int(3)
31 ["timezone"]=>
32 string(3) "UTC"
33 }
34 }
35 }
36}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/system/customfieldvalues"
4)
5
6result, err := customfieldvalues.Getlist(client, &ticketmatic.CustomFieldValueQuery{
7 Typeid: 10000,
8 Filter: "select id from tm.customfieldvalues WHERE createdts > (now() - INTERVAL '30 days')",
9 Includearchived: true,
10 Lastupdatesince: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
11})
12
13// The query object is optional, it can be omitted when empty.
14result, err := customfieldvalues.Getlist(client, nil)
Response
1result := customfieldvalues.&List{
2 Data: []*ticketmatic.CustomFieldValue{
3 &ticketmatic.CustomFieldValue{
4 Id: 123,
5 Typeid: 10000,
6 Caption: "Rock",
7 Sortorder: 0,
8 Isarchived: false,
9 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
10 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
11 },
12 },
13}
Request
1GET /api/1/{accountname}/settings/system/customfieldvalues HTTP/1.1
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "data": [
6 {
7 "id": 123,
8 "typeid": 10000,
9 "caption": "Rock",
10 "sortorder": 0,
11 "isarchived": false,
12 "createdts": "2014-09-26 15:24:36",
13 "lastupdatets": "2014-09-26 15:24:36"
14 }
15 ]
16}
Parameters
Field | Description |
---|---|
typeid
|
Type reference: CustomFieldValueQuery
Result fields
This call returns an object with an array of objects in the data
field.
Field | Description |
---|---|
id int | Unique ID Example value:123 |
typeid int | Type ID Example value:10000 |
caption | Human-readable name for the value Example value:"Rock" |
sortorder int | Indicated the manual sort order |
isarchived bool | Whether or not this item is archived |
createdts timestamp | Created timestamp Example value:"2014-09-26 15:24:36" |
lastupdatets timestamp | Last updated timestamp Example value:"2014-09-26 15:24:36" |
Type reference: CustomFieldValue[]