From 4962dc53f3e0d7f9dbe4a0d3b3bda99e438da1a0 Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Mon, 9 Mar 2020 17:54:12 -0500 Subject: [PATCH 1/7] Added Get-CWMboardTeams --- CWManage.psm1 | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index 170cd87..965c839 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4038,6 +4038,68 @@ function Get-CWMServiceBoard { } #endregion [BoardItems]------- +#region [BoardTeams]------- +function Get-CWMBoardTeam { + <# + .SYNOPSIS + This function will list the teams of a service board based on conditions. + + .PARAMETER ServiceBoardID + The ID of the service board you want to retrieve teams for. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMBoardTeam -ServiceBoardID 123 -Condition 'name like "Windows*"' + Will return all teams on the service board that have a name that begins with the word "Windows", such as "Windows Server Team" + + .NOTES + Author: Michael Clark (@ClarkMichaelA) + Date: 03/09/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?a=Company&e=CompanyTeams&o=GET#/ + #> + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [int]$ServiceBoardID, + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/boards/$ServiceBoardID/teams" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [BoardTeams]------- #endregion [Service]------- #region [System]------- From 64510491572d54336960d1661153188daee81332 Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Mon, 9 Mar 2020 18:11:45 -0500 Subject: [PATCH 2/7] Corrected URL link --- CWManage.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CWManage.psm1 b/CWManage.psm1 index 965c839..cc9f907 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4079,7 +4079,7 @@ function Get-CWMBoardTeam { Date: 03/09/2020 .LINK - https://developer.connectwise.com/Products/Manage/REST?a=Company&e=CompanyTeams&o=GET#/ + https://developer.connectwise.com/Products/Manage/REST?#/BoardTeams #> [CmdletBinding()] param( From 28d435d4d1a580fad5034f4238cdcc50d8d7a3ec Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Mon, 9 Mar 2020 18:25:24 -0500 Subject: [PATCH 3/7] Created Get-CWMPriority --- CWManage.psm1 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index cc9f907..fcb1cc4 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4100,6 +4100,64 @@ function Get-CWMBoardTeam { return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI } #endregion [BoardTeams]------- + +#region [Priorities]------- +function Get-CWMPriority { + <# + .SYNOPSIS + This function will list service priorities on conditions. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMPriority -Condition 'name like "*Emergency*"' + Will return all priorities that include the word "Emergency", such as "Priority 1 - Emergency" + + .NOTES + Author: Michael Clark (@ClarkMichaelA) + Date: 03/09/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?#/Priorities/getServicePriorities + #> + [CmdletBinding()] + param( + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/priorities" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [Priorities]------- #endregion [Service]------- #region [System]------- From df4ed466844eb8916e91c0760856fc5300088713 Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Mon, 9 Mar 2020 18:44:13 -0500 Subject: [PATCH 4/7] Created Get-CWMBoardTypes --- CWManage.psm1 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index fcb1cc4..77243b1 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4038,6 +4038,69 @@ function Get-CWMServiceBoard { } #endregion [BoardItems]------- +#region [BoardTypes]------- +function Get-CWMBoardTypes { + <# + .SYNOPSIS + This function will list the types of a service board based on conditions. + + .PARAMETER ServiceBoardID + The ID of the service board you want to retrieve types for. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMBoardTypes -ServiceBoardID -Condition "name like *service*" -all + Will return all types that have the word "service" within them, such as a type named "Service Request" + + .NOTES + Author: Michael A. Clark (@ClarkMichaelA) + Date: 03/09/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?#/BoardTypes + #> + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [int]$ServiceBoardID, + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/boards/$ServiceBoardID/types" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [BoardTypes]------- + #region [BoardTeams]------- function Get-CWMBoardTeam { <# From 34d93398e51b01d2226a31b92778ff6a1a1f7c4b Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Mon, 9 Mar 2020 18:51:11 -0500 Subject: [PATCH 5/7] Added Get-CWMBoardSubtypes --- CWManage.psm1 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index 77243b1..15e07fd 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4101,6 +4101,70 @@ function Get-CWMBoardTypes { } #endregion [BoardTypes]------- +#region [BoardSubtypes]------- +function Get-CWMBoardSubtypes { + <# + .SYNOPSIS + This function will list the subtypes of a service board based on conditions. + + .PARAMETER ServiceBoardID + The ID of the service board you want to retrieve subtypes for. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMBoardSubtypes -ServiceBoardID -Condition "name like *mail*" -all + Will return all types that have the word "mail" within them, such as a type named "Mailbox" + + .NOTES + Author: Michael A. Clark (@ClarkMichaelA) + Date: 03/09/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?#/BoardSubTypes + #> + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [int]$ServiceBoardID, + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/boards/$ServiceBoardID/subtypes" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [BoardSubtypes]------- + + #region [BoardTeams]------- function Get-CWMBoardTeam { <# From 5f8ca5ae4fb6931dc9f846baba9e39810771b599 Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Tue, 10 Mar 2020 01:42:20 -0500 Subject: [PATCH 6/7] Added Get-CMWBoardItems --- CWManage.psm1 | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index 15e07fd..066bb2d 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4164,6 +4164,68 @@ function Get-CWMBoardSubtypes { } #endregion [BoardSubtypes]------- +#region [BoardItems]------- +function Get-CWMBoardItems { + <# + .SYNOPSIS + This function will list the items of a service board based on conditions. + + .PARAMETER ServiceBoardID + The ID of the service board you want to retrieve items for. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMBoardItems -ServiceBoardID -Condition "name like *mail*" -all + Will return all items that have the word "mail" within them, such as an item named "Mailbox" + + .NOTES + Author: Michael A. Clark (@ClarkMichaelA) + Date: 03/09/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?#/BoardItems + #> + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [int]$ServiceBoardID, + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/boards/$ServiceBoardID/items" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [BoardItems]------- #region [BoardTeams]------- function Get-CWMBoardTeam { From 524b37252be1547cb3043aba13fa067c9d9c7fb6 Mon Sep 17 00:00:00 2001 From: "Michael A. Clark" Date: Tue, 10 Mar 2020 15:30:29 -0500 Subject: [PATCH 7/7] Added Get-CWMSources --- CWManage.psm1 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/CWManage.psm1 b/CWManage.psm1 index 066bb2d..00acaed 100644 --- a/CWManage.psm1 +++ b/CWManage.psm1 @@ -4347,6 +4347,66 @@ function Get-CWMPriority { return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI } #endregion [Priorities]------- + +#region [Sources]------- + +function Get-CWMSources { + <# + .SYNOPSIS + This function will list service sources on conditions. + + .PARAMETER Condition + This is your search condition to return the results you desire. + Example: + (contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary" + + .PARAMETER orderBy + Choose which field to sort the results by + + .PARAMETER childconditions + Allows searching arrays on endpoints that list childConditions under parameters + + .PARAMETER customfieldconditions + Allows searching custom fields when customFieldConditions is listed in the parameters + + .PARAMETER page + Used in pagination to cycle through results + + .PARAMETER pageSize + Number of results returned per page (Defaults to 25) + + .PARAMETER all + Return all results + + .EXAMPLE + Get-CWMSources -Condition 'name like "*Phone*"' + Will return all priorities that include the word "Phone", such as "Phone Source" + + .NOTES + Author: Michael Clark (@ClarkMichaelA) + Date: 03/10/2020 + + .LINK + https://developer.connectwise.com/Products/Manage/REST?#/Sources/getServiceSources + #> + [CmdletBinding()] + param( + [string]$Condition, + [ValidateSet('asc','desc')] + $orderBy, + [string]$childconditions, + [string]$customfieldconditions, + [int]$page, + [int]$pageSize, + [switch]$all + ) + + $URI = "https://$($global:CWMServerConnection.Server)/v4_6_release/apis/3.0/service/sources" + + return Invoke-CWMGetMaster -Arguments $PsBoundParameters -URI $URI +} +#endregion [Sources]------- + #endregion [Service]------- #region [System]-------