Skip to content

Commit 00335a2

Browse files
authored
Merge pull request #45 from squaredup/work/tw/AutoTask
2 parents 1174f41 + b73c422 commit 00335a2

22 files changed

Lines changed: 1213 additions & 0 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.github/* @squaredup/community-moderators
55

66
# Request review from original author
7+
plugins/AutoTask/* @TimWheeler-SQUP
78
plugins/DattoRMM/* @TimWheeler-SQUP
89
plugins/DigiCert/* @shaswot77
910
plugins/FantasyPremierLeague/* @TimWheeler-SQUP
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"steps": [
3+
{
4+
"displayName": "Autotask connection",
5+
"dataStream": { "name": "companies", "timeframe": "none" },
6+
"success": "Successfully connected to Autotask",
7+
"error": "Cannot connect to Autotask — check your Zone URL, Integration Code, Username and Secret",
8+
"required": true
9+
}
10+
]
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"name": "Autotask Company",
4+
"sourceType": "autotask-company",
5+
"icon": "building-2",
6+
"singular": "Company",
7+
"plural": "Companies"
8+
},
9+
{
10+
"name": "AutotaskContact",
11+
"sourceType": "autotask-contact",
12+
"icon": "user",
13+
"singular": "Contact",
14+
"plural": "Contacts"
15+
},
16+
{
17+
"name": "AutotaskProject",
18+
"sourceType": "autotask-project",
19+
"icon": "folder-kanban",
20+
"singular": "Project",
21+
"plural": "Projects"
22+
},
23+
{
24+
"name": "AutotaskResource",
25+
"sourceType": "autotask-resource",
26+
"icon": "hard-hat",
27+
"singular": "Resource",
28+
"plural": "Resources"
29+
},
30+
{
31+
"name": "AutotaskContract",
32+
"sourceType": "autotask-contract",
33+
"icon": "file-text",
34+
"singular": "Contract",
35+
"plural": "Contracts"
36+
}
37+
]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "companies",
3+
"displayName": "Companies",
4+
"description": "All active companies in AutoTask",
5+
"tags": ["Companies"],
6+
"baseDataSourceName": "httpRequestUnscoped",
7+
"timeframes": false,
8+
"config": {
9+
"httpMethod": "get",
10+
"expandInnerObjects": true,
11+
"endpointPath": "atservicesrest/v1.0/Companies/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
12+
"pathToData": "items",
13+
"paging": {
14+
"mode": "nextUrl",
15+
"pageSize": { "realm": "none" },
16+
"in": {
17+
"realm": "payload",
18+
"path": "pageDetails.nextPageUrl"
19+
}
20+
}
21+
},
22+
"metadata": [
23+
{ "name": "companyName", "displayName": "Company Name" },
24+
{ "name": "isActive", "displayName": "Is Active" },
25+
{ "name": "phone", "displayName": "Phone" },
26+
{ "name": "address1", "displayName": "Address" },
27+
{ "name": "city", "displayName": "City" },
28+
{ "name": "state", "displayName": "State" },
29+
{ "name": "postalCode", "displayName": "Postal Code" },
30+
{ "name": "country", "displayName": "Country" },
31+
{ "name": "createDate", "displayName": "Created Date", "shape": ["date", { "timeZone": "Etc/UTC" }] },
32+
{ "name": "ownerResourceID", "sourceType": "autotask-resource", "shape": "string", "visible": false },
33+
{ "name": "ownerResourceName", "displayName": "Owner", "sourceId": "ownerResourceID", "objectPropertyPath": "name" },
34+
{ "pattern": ".*" }
35+
]
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "contacts",
3+
"displayName": "Contacts",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"visibility": { "type": "hidden" },
6+
"timeframes": false,
7+
"config": {
8+
"httpMethod": "get",
9+
"expandInnerObjects": true,
10+
"endpointPath": "atservicesrest/v1.0/Contacts/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
11+
"pathToData": "items",
12+
"paging": {
13+
"mode": "nextUrl",
14+
"pageSize": { "realm": "none" },
15+
"in": {
16+
"realm": "payload",
17+
"path": "pageDetails.nextPageUrl"
18+
}
19+
}
20+
},
21+
"metadata": [
22+
{ "name": "id", "displayName": "ID", "shape": "string" },
23+
{
24+
"name": "fullName",
25+
"displayName": "Full Name",
26+
"computed": true,
27+
"valueExpression": "{{ $['firstName'] + ' ' + $['lastName'] }}"
28+
},
29+
{ "pattern": ".*" }
30+
]
31+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "contracts",
3+
"displayName": "Contracts",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"visibility": { "type": "hidden" },
6+
"timeframes": false,
7+
"config": {
8+
"httpMethod": "get",
9+
"expandInnerObjects": true,
10+
"endpointPath": "atservicesrest/v1.0/Contracts/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
11+
"pathToData": "items",
12+
"paging": {
13+
"mode": "nextUrl",
14+
"pageSize": { "realm": "none" },
15+
"in": {
16+
"realm": "payload",
17+
"path": "pageDetails.nextPageUrl"
18+
}
19+
}
20+
}
21+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "financialHealth",
3+
"displayName": "Financial Health",
4+
"description": "Estimated revenue, cost, and hours across all contracts",
5+
"tags": ["Finance"],
6+
"baseDataSourceName": "httpRequestUnscoped",
7+
"timeframes": false,
8+
"config": {
9+
"httpMethod": "get",
10+
"expandInnerObjects": true,
11+
"endpointPath": "atservicesrest/v1.0/Contracts/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
12+
"pathToData": "items",
13+
"paging": {
14+
"mode": "nextUrl",
15+
"pageSize": { "realm": "none" },
16+
"in": {
17+
"realm": "payload",
18+
"path": "pageDetails.nextPageUrl"
19+
}
20+
}
21+
},
22+
"metadata": [
23+
{ "name": "id", "displayName": "ID", "visible": false, "shape":"string" },
24+
{ "name": "contractName", "displayName": "Contract Name" },
25+
{
26+
"name": "contractTypeName",
27+
"displayName": "Contract Type",
28+
"computed": true,
29+
"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' }}"
30+
},
31+
{ "name": "estimatedRevenue", "displayName": "Estimated Revenue", "shape": ["number", { "decimalPlaces": 2 }] },
32+
{ "name": "estimatedCost", "displayName": "Estimated Cost", "shape": ["number", { "decimalPlaces": 2 }] },
33+
{ "name": "estimatedHours", "displayName": "Estimated Hours", "shape": ["number", { "decimalPlaces": 2 }] },
34+
{
35+
"name": "statusName",
36+
"displayName": "Status",
37+
"computed": true,
38+
"valueExpression": "{{ $['status'] == 1 ? 'Active' : $['status'] == 2 ? 'Upcoming' : $['status'] == 3 ? 'Cancelled' : $['status'] == 4 ? 'Completed' : $['status'] == 6 ? 'Inactive' : 'Unknown' }}",
39+
"shape": ["state", {
40+
"map": {
41+
"success": ["Active", "Completed"],
42+
"error": ["Cancelled"],
43+
"warning": ["Upcoming"],
44+
"unknown": ["Inactive", "Unknown"]
45+
}
46+
}]
47+
},
48+
{ "pattern": ".*" }
49+
]
50+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "projectStatus",
3+
"displayName": "Project Status",
4+
"description": "Status, progress, and schedule for all projects",
5+
"tags": ["Projects"],
6+
"baseDataSourceName": "httpRequestUnscoped",
7+
"timeframes": false,
8+
"config": {
9+
"httpMethod": "get",
10+
"expandInnerObjects": true,
11+
"endpointPath": "atservicesrest/v1.0/Projects/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
12+
"pathToData": "items",
13+
"paging": {
14+
"mode": "nextUrl",
15+
"pageSize": { "realm": "none" },
16+
"in": {
17+
"realm": "payload",
18+
"path": "pageDetails.nextPageUrl"
19+
}
20+
}
21+
},
22+
"metadata": [
23+
{ "name": "id", "displayName": "ID", "shape": "string" },
24+
{ "name": "projectName", "displayName": "Project Name" },
25+
{ "name": "status", "displayName": "Status (Raw)", "shape": ["number", { "decimalPlaces": 0 }], "visible": false },
26+
{
27+
"name": "statusName",
28+
"displayName": "Status",
29+
"computed": true,
30+
"valueExpression": "{{ $['status'] == 1 ? 'Active' : $['status'] == 2 ? 'Inactive' : $['status'] == 3 ? 'Completed' : $['status'] == 5 ? 'On Hold' : 'Unknown' }}",
31+
"shape": ["state", {
32+
"map": {
33+
"success": ["Active", "Completed"],
34+
"warning": ["On Hold"],
35+
"unknown": ["Inactive", "Unknown"]
36+
}
37+
}]
38+
},
39+
{ "name": "completedPercentage", "displayName": "Completed %", "shape": ["number", { "decimalPlaces": 0 }] },
40+
{ "name": "actualHours", "displayName": "Actual Hours", "shape": ["number", { "decimalPlaces": 2 }] },
41+
{ "name": "estimatedTime", "displayName": "Estimated Hours", "shape": ["number", { "decimalPlaces": 2 }] },
42+
{ "name": "startDateTime", "displayName": "Start Date", "shape": ["date", { "timeZone": "Etc/UTC" }] },
43+
{ "name": "endDateTime", "displayName": "End Date", "shape": ["date", { "timeZone": "Etc/UTC" }] },
44+
{ "pattern": ".*" }
45+
]
46+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "projects",
3+
"displayName": "Projects",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"visibility": { "type": "hidden" },
6+
"timeframes": false,
7+
"config": {
8+
"httpMethod": "get",
9+
"expandInnerObjects": true,
10+
"endpointPath": "atservicesrest/v1.0/Projects/query?search={\"MaxRecords\":500,\"filter\":[{\"op\":\"exist\",\"field\":\"id\"}]}",
11+
"pathToData": "items",
12+
"paging": {
13+
"mode": "nextUrl",
14+
"pageSize": { "realm": "none" },
15+
"in": {
16+
"realm": "payload",
17+
"path": "pageDetails.nextPageUrl"
18+
}
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)