File tree Expand file tree Collapse file tree 3 files changed +54
-2
lines changed
api-reference/graphql/threads Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ mutation createThread($input: CreateThreadInput!) {
15
15
title
16
16
previewText
17
17
priority
18
+ threadFields {
19
+ id
20
+ key
21
+ type
22
+ stringValue
23
+ booleanValue
24
+ }
18
25
}
19
26
error {
20
27
message
@@ -44,7 +51,26 @@ mutation createThread($input: CreateThreadInput!) {
44
51
}
45
52
}
46
53
],
47
- "labelTypeIds" : [" lt_01HB924PME9C0YWKW1N4AK3BZA" ]
54
+ "labelTypeIds" : [" lt_01HB924PME9C0YWKW1N4AK3BZA" ],
55
+ "threadFields" : [
56
+ {
57
+ "key" : " my_string_field" ,
58
+ "type" : " STRING" ,
59
+ "stringValue" : " any value"
60
+ }
61
+ ]
62
+ // You can also set other thread field types like boolean or enum.
63
+ // "threadFields": [{
64
+ // "key": "my_enum_field",
65
+ // "type": "ENUM",
66
+ // "stringValue": "any specified value",
67
+ // }],
68
+ //
69
+ // "threadFields": [{
70
+ // "key": "my_bool_field",
71
+ // "type": "BOOL",
72
+ // "booleanValue": true,
73
+ // }],
48
74
}
49
75
}
50
76
```
Original file line number Diff line number Diff line change 1
1
``` ts
2
- import { PlainClient } from ' @team-plain/typescript-sdk' ;
2
+ import { PlainClient , ThreadFieldSchemaType } from ' @team-plain/typescript-sdk' ;
3
3
4
4
const client = new PlainClient ({ apiKey: ' plainApiKey_xxx' });
5
5
@@ -25,6 +25,29 @@ const res = await client.createThread({
25
25
// Label types are created in settings where you can also copy
26
26
// their ID.
27
27
labelTypeIds: [' lt_01HB924PME9C0YWKW1N4AK3BZA' ],
28
+
29
+ // Thread fields are created in settings where you can also copy
30
+ // their key.
31
+ threadFields: [
32
+ {
33
+ key: ' my_string_field' ,
34
+ type: ThreadFieldSchemaType .String ,
35
+ stringValue: ' any value' ,
36
+ },
37
+ ],
38
+
39
+ // You can also set other thread field types like boolean or enum.
40
+ // threadFields: [{
41
+ // key: 'my_enum_field',
42
+ // type: ThreadFieldSchemaType.Enum,
43
+ // stringValue: 'any specified value',
44
+ // }]
45
+ //
46
+ // threadFields: [{
47
+ // key: 'my_bool_field',
48
+ // type: ThreadFieldSchemaType.Bool,
49
+ // booleanValue: true,
50
+ // }],
28
51
});
29
52
30
53
if (res .error ) {
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ To create a thread you need a `customerId`. You can get a customer id by [creati
23
23
- ` thread:create `
24
24
- ` thread:edit `
25
25
- ` thread:read `
26
+ - ` threadField:create `
27
+ - ` threadField:update `
28
+ - ` threadField:read `
26
29
27
30
<Snippet file = " typescript-sdk/create-thread.mdx" />
28
31
You can’t perform that action at this time.
0 commit comments