You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/freshservice/tickets.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ A ticket can be an incident or a service request. An incident is a disruption to
12
12
13
13
## Ticket
14
14
15
-
These APIs help to list, retrive, create, update, delete, restore and other operations associated with FreshService tickets
15
+
These APIs help to list, retrive, create, update, delete, restore and other operations associated with FreshService tickets. All the methods return response into Response object. The response object has 3 supported elements and 1 method as depicted below
16
+
17
+
- Use object.json() to access the object elements
18
+
- Use object.statusCode to access object HTTP status code returned by the endpoint
19
+
- Use object.header to access returned headers.
16
20
17
21
### List tickets
18
22
@@ -21,6 +25,9 @@ Fetch the list of all Tickets in Freshservice
21
25
```js
22
26
// Using with query parameters included
23
27
consttickets=awaitfs.tickets.list();
28
+
// use tickets.json() to access object elements
29
+
// use tickets.header access returned headers
30
+
// use tickets.statusCode access returned HTTP status code
24
31
```
25
32
26
33
```js
@@ -32,6 +39,9 @@ const query = {
32
39
order_type:"asc"
33
40
};
34
41
consttickets=awaitfs.tickets.list(query);
42
+
// use tickets.json() to access object elements
43
+
// use tickets.header access returned headers
44
+
// use tickets.statusCode access returned HTTP status code
35
45
```
36
46
37
47
- Returns a `Promise` that resolves to an [`Freshservice.models.Tickets`](../api/classes/freshservice_models.Tickets.html) object
@@ -45,13 +55,19 @@ Get the details of a Freshservice Ticket
45
55
// Using without query parameters included
46
56
constticket_id=99999;
47
57
constticket=awaitfs.tickets.get(ticket_id);
58
+
// use ticket.json() to access object elements
59
+
// use ticket.header access returned headers
60
+
// use ticket.statusCode access returned HTTP status code
48
61
```
49
62
50
63
```js
51
64
// Using with query parameters included
52
65
constticket_id=99999;
53
66
constinclude="stats";
54
67
constticket=awaitfs.tickets.get(ticket_id, { include });
68
+
// use ticket.json() to access object elements
69
+
// use ticket.header access returned headers
70
+
// use ticket.statusCode access returned HTTP status code
55
71
```
56
72
57
73
- The first argument is the ticket ID - identifier of the ticket to be updated
@@ -91,6 +107,9 @@ const ticket = {
91
107
]
92
108
}
93
109
constnewTicket=awaitfs.tickets.create(ticket);
110
+
// use newTicket.json() to access object elements
111
+
// use newTicket.header access returned headers
112
+
// use newTicket.statusCode access returned HTTP status code
94
113
```
95
114
96
115
- Returns a `Promise` that resolves to a [`Freshservice.models.Ticket`](../api/classes/freshservice_models.Ticket.html) object
@@ -101,6 +120,7 @@ Edit an existing Freshservice Ticket
// use newTimeEntry.json() to access object elements
224
250
```
225
251
226
252
- The first argument is an object of type [`Freshservice.models.TimeEntry`](.../api/classes/freshservice_models.TimeEntry.html) containing the details of time entry to be created
@@ -233,6 +259,7 @@ Update time entry for ticket with given ticket ID and time entry ID
// use updatedTimeEntry.json() to access object elements
236
263
```
237
264
238
265
- The first argument is an object of type [`Freshservice.models.TimeEntry`](.../api/classes/freshservice_models.TimeEntry.html) containing the details of time entry to be updated
@@ -246,6 +273,7 @@ Remove a time entry on a freshservice ticket
// use deleteTimeEntry.json() to access object elements
249
277
```
250
278
251
279
- The first argument is the ticket ID - identifier of the ticket for which time entry is to be deleted
@@ -262,6 +290,7 @@ const source = {
262
290
position:1
263
291
};
264
292
constfieldSource=awaitfs.tickets.source(source);
293
+
// use fieldSource.json() to access object elements
265
294
```
266
295
267
296
- The source argument is an object of type [`Freshservice.models.TicketSource`](../api/classes/freshservice_models.TicketSource.html) containing the details of custom ticket source to be created
- The first argument is an object of type [`Freshservice.models.Task`](../api/classes/freshservice_models.Task.html) containing details of task to be created
@@ -300,6 +330,7 @@ Retrieve a task on a ticket request with the given ID from Freshservice
// use updateTask.json() to access object elements
349
383
```
350
384
351
385
- The first argument is an object of type [`Freshservice.models.Task`](../api/classes/freshservice_models.Task.html) containing details of task to be updated
@@ -361,6 +395,7 @@ Delete the task on a ticket request with the given ID from Freshservice
0 commit comments