|
| 1 | +{ |
| 2 | + "name": "contractStatus", |
| 3 | + "displayName": "Contract Status", |
| 4 | + "description": "Status and key dates for contracts belonging to the selected company", |
| 5 | + "tags": ["Contracts"], |
| 6 | + "baseDataSourceName": "httpRequestScopedSingle", |
| 7 | + "timeframes": false, |
| 8 | + "matches": { |
| 9 | + "sourceType": "autotask-company" |
| 10 | + }, |
| 11 | + "config": { |
| 12 | + "httpMethod": "get", |
| 13 | + "expandInnerObjects": true, |
| 14 | + "endpointPath": "atservicesrest/v1.0/Contracts/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"eq\",\"field\":\"companyID\",\"value\":{{objects[0].companyId}}}]}", |
| 15 | + "pathToData": "items", |
| 16 | + "paging": { |
| 17 | + "mode": "nextUrl", |
| 18 | + "pageSize": { "realm": "none" }, |
| 19 | + "in": { |
| 20 | + "realm": "payload", |
| 21 | + "path": "pageDetails.nextPageUrl" |
| 22 | + } |
| 23 | + } |
| 24 | + }, |
| 25 | + "metadata": [ |
| 26 | + { "name": "sourceId", "displayName": "Object ID", "shape": "string", "visible": false }, |
| 27 | + { "name": "id", "displayName": "ID", "sourceType": "autotask-contract", "shape": "string", "visible": false }, |
| 28 | + { "name": "contractName", "displayName": "Contract Name" }, |
| 29 | + { "name": "companyID", "displayName": "Company ID", "sourceType": "autotask-company", "shape": "string", "visible": false }, |
| 30 | + { "name": "companyName", "displayName": "Company", "sourceId": "companyID", "objectPropertyPath": "name" }, |
| 31 | + { |
| 32 | + "name": "contractTypeName", |
| 33 | + "displayName": "Contract Type", |
| 34 | + "computed": true, |
| 35 | + "valueExpression": "{{ $['contractType'] == 1 ? 'Time and Materials' : $['contractType'] == 3 ? 'Fixed Price' : $['contractType'] == 4 ? 'Block Hours' : $['contractType'] == 6 ? 'Retainer' : $['contractType'] == 7 ? 'Recurring Service' : $['contractType'] == 8 ? 'Incident' : 'Unknown' }}" |
| 36 | + }, |
| 37 | + { |
| 38 | + "name": "statusName", |
| 39 | + "displayName": "Status", |
| 40 | + "computed": true, |
| 41 | + "valueExpression": "{{ $['status'] == 1 ? 'Active' : $['status'] == 2 ? 'Upcoming' : $['status'] == 3 ? 'Cancelled' : $['status'] == 4 ? 'Completed' : $['status'] == 6 ? 'Inactive' : 'Unknown' }}", |
| 42 | + "shape": ["state", { |
| 43 | + "map": { |
| 44 | + "success": ["Active", "Completed"], |
| 45 | + "error": ["Cancelled"], |
| 46 | + "warning": ["Upcoming"], |
| 47 | + "unknown": ["Inactive", "Unknown"] |
| 48 | + } |
| 49 | + }] |
| 50 | + }, |
| 51 | + { "name": "startDate", "displayName": "Start Date", "shape": ["date", { "timeZone": "Etc/UTC" }] }, |
| 52 | + { "name": "endDate", "displayName": "End Date", "shape": ["date", { "timeZone": "Etc/UTC" }] }, |
| 53 | + { "pattern": ".*" } |
| 54 | + ] |
| 55 | +} |
0 commit comments