|
11 | 11 | "config": { |
12 | 12 | "httpMethod": "get", |
13 | 13 | "expandInnerObjects": true, |
14 | | - "endpointPath": "atservicesrest/v1.0/Tickets/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"in\",\"field\":\"status\",\"value\":[{{statusFilter}}]},{\"op\":\"in\",\"field\":\"priority\",\"value\":[{{priorityFilter}}]},{\"op\":\"gte\",\"field\":\"lastActivityDate\",\"value\":\"{{timeframe.start}}\"},{\"op\":\"lte\",\"field\":\"lastActivityDate\",\"value\":\"{{timeframe.end}}\"}]}", |
| 14 | + "endpointPath": "atservicesrest/v1.0/Tickets/query?search={\"MaxRecords\":500,\"filter\":[{{statusFilter ? '{\"op\":\"in\",\"field\":\"status\",\"value\":[' + statusFilter + ']},' : ''}}{{priorityFilter ? '{\"op\":\"in\",\"field\":\"priority\",\"value\":[' + priorityFilter + ']},' : ''}}{\"op\":\"gte\",\"field\":\"lastActivityDate\",\"value\":\"{{timeframe.start}}\"},{\"op\":\"lte\",\"field\":\"lastActivityDate\",\"value\":\"{{timeframe.end}}\"}]}", |
15 | 15 | "postRequestScript": "tickets.js", |
16 | 16 | "pathToData": "items", |
17 | 17 | "paging": { |
|
28 | 28 | { "name": "id", "displayName": "Ticket ID", "shape": "string", "visible": false }, |
29 | 29 | { "name": "title", "displayName": "Title" }, |
30 | 30 | { "name": "description", "displayName": "Description", "visible": false }, |
| 31 | + { "name": "status", "displayName": "Status (Raw)", "sourceType": "autotask-ticket-status", "shape": "string", "visible": false }, |
31 | 32 | { |
32 | 33 | "name": "statusName", |
33 | 34 | "displayName": "Status", |
34 | | - "visible": true, |
| 35 | + "sourceId": "status", |
| 36 | + "objectPropertyPath": "name" |
| 37 | + }, |
| 38 | + { |
| 39 | + "name": "statusHealth", |
| 40 | + "displayName": "Status Health", |
35 | 41 | "computed": true, |
36 | | - "valueExpression": "{{ $['status'] == 1 ? 'New' : $['status'] == 5 ? 'Complete' : $['status'] == 8 ? 'In Progress' : $['status'] == 9 ? 'Waiting Customer' : $['status'] == 10 ? 'Waiting Materials' : $['status'] == 11 ? 'Waiting Vendor' : $['status'] == 12 ? 'Escalate' : $['status'] == 13 ? 'Waiting Approval' : 'Unknown' }}", |
| 42 | + "valueExpression": "{{ $['statusName'] }}", |
37 | 43 | "shape": ["state", { |
38 | 44 | "map": { |
39 | 45 | "success": ["Complete"], |
40 | 46 | "error": ["Escalate"], |
41 | | - "warning": ["New", "In Progress"], |
42 | | - "unknown": ["Waiting Customer", "Waiting Materials", "Waiting Vendor", "Waiting Approval", "Unknown"] |
| 47 | + "warning": ["New", "In Progress", "Waiting Customer", "Waiting Materials", "Waiting Vendor", "Waiting for Vendor", "Waiting Approval"] |
43 | 48 | } |
44 | 49 | }] |
45 | 50 | }, |
46 | 51 | { |
47 | 52 | "name": "priorityName", |
48 | 53 | "displayName": "Priority", |
49 | | - "computed": true, |
50 | | - "valueExpression": "{{ $['priority'] == 1 ? 'Critical' : $['priority'] == 2 ? 'High' : $['priority'] == 3 ? 'Medium' : $['priority'] == 4 ? 'Low' : 'Unknown' }}" |
| 54 | + "sourceId": "priority", |
| 55 | + "objectPropertyPath": "name" |
51 | 56 | }, |
52 | | - { "name": "priority", "displayName": "Priority (Raw)", "shape": ["number", { "decimalPlaces": 0 }], "visible": false }, |
| 57 | + { "name": "priority", "displayName": "Priority (Raw)", "sourceType": "autotask-ticket-priority", "shape": "string", "visible": false }, |
53 | 58 | { "name": "companyID", "sourceType": "autotask-company", "shape": "string", "visible": false }, |
54 | 59 | { "name": "companyName", "displayName": "Company", "sourceId": "companyID", "objectPropertyPath": "name" }, |
55 | 60 | { "name": "contactID", "sourceType": "autotask-contact", "shape": "string", "visible": false }, |
|
137 | 142 | "label": "Status", |
138 | 143 | "allowCustomValues": true, |
139 | 144 | "isMulti": true, |
140 | | - "defaultValue": "1,5,8,9,10,11,12,13", |
141 | 145 | "data": { |
142 | | - "source": "fixed", |
143 | | - "values": [ |
144 | | - { "value": "1,5,8,9,10,11,12,13", "label": "All Statuses" }, |
145 | | - { "value": "1", "label": "New" }, |
146 | | - { "value": "8", "label": "In Progress" }, |
147 | | - { "value": "9", "label": "Waiting Customer" }, |
148 | | - { "value": "10", "label": "Waiting Materials" }, |
149 | | - { "value": "11", "label": "Waiting Vendor" }, |
150 | | - { "value": "13", "label": "Waiting Approval" }, |
151 | | - { "value": "12", "label": "Escalate" }, |
152 | | - { "value": "5", "label": "Complete" } |
153 | | - ] |
154 | | - }, |
155 | | - "validation": { "required": true } |
| 146 | + "source": "dataStream", |
| 147 | + "dataStreamName": "ticketStatuses", |
| 148 | + "dataSourceConfig": {} |
| 149 | + } |
156 | 150 | }, |
157 | 151 | { |
158 | 152 | "name": "priorityFilter", |
159 | 153 | "type": "autocomplete", |
160 | 154 | "label": "Priority", |
161 | 155 | "allowCustomValues": true, |
162 | 156 | "isMulti": true, |
163 | | - "defaultValue": "1,2,3,4", |
164 | 157 | "data": { |
165 | | - "source": "fixed", |
166 | | - "values": [ |
167 | | - { "value": "1,2,3,4", "label": "All Priorities" }, |
168 | | - { "value": "1", "label": "Critical" }, |
169 | | - { "value": "2", "label": "High" }, |
170 | | - { "value": "3", "label": "Medium" }, |
171 | | - { "value": "4", "label": "Low" } |
172 | | - ] |
173 | | - }, |
174 | | - "validation": { "required": true } |
| 158 | + "source": "dataStream", |
| 159 | + "dataStreamName": "ticketPriorities", |
| 160 | + "dataSourceConfig": {} |
| 161 | + } |
175 | 162 | } |
176 | 163 | ] |
177 | 164 | } |
0 commit comments