Skip to content

Commit a289cd4

Browse files
committed
update README.md
1 parent 73989ec commit a289cd4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,22 @@ Ticket.create(ticketTitle, userName, (ticket, err) =>
6161
});
6262
```
6363

64-
> Note: `Ticket.create()` has 2 more parameters `groupKey` and `customFields`. The values could be evaluated when a ticket is created though it's used only in Dashboard currently. `groupKey` is the key of an agent group so that the ticket is assigned to the agents in that group. `customFields` holds customizable data for the individual ticket.
64+
`Ticket.create()` has 2 more parameters `groupKey` and `customFields`. The values could be evaluated when a ticket is created though it's used only in Dashboard currently. `groupKey` is the key of an agent group so that the ticket is assigned to the agents in that group. `customFields` holds customizable data for the individual ticket. The below is an example.
65+
66+
```js
67+
Ticket.create(ticketTitle, userName,
68+
'cs-team-1', // groupKey
69+
{
70+
'text': 'hello',
71+
'number': 14,
72+
'select': 'option2'
73+
}, // customFields
74+
(ticket, err) => {
75+
// Ticket is created with groupKey 'cs-team-1' and customFields.
76+
});
77+
```
78+
79+
> Note: each key in `customFields` should be preregistered in Dashboard. Otherwise, the key would be ignored.
6580
6681
## Count of opened tickets
6782
When you need to display opened ticket count in your application, use `Ticket.getOpenCount()`.

0 commit comments

Comments
 (0)