Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
!Deploy!
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Smith committed Jun 6, 2021
1 parent bce2e5b commit ae1e6ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Format as below (Requires the '### Added' as a header or task fails)
...- Update ReadMe.MD

## [Unreleased]
### Added
- Updated Get-InsightStatusTypes to support SchemaID

## [1.18] - 2021-06-06
### Added
Expand Down
20 changes: 8 additions & 12 deletions JSM.Insight/Public/Get-InsightStatusTypes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
function Get-InsightStatusTypes {
[CmdletBinding()]
param (
[string]$objectSchemaId,
[String]$Version = "1",
[string]$InsightCreds = $InsightCreds,
[string]$InsightWorkspaceID = $InsightWorkspaceID
Expand All @@ -13,20 +14,15 @@ function Get-InsightStatusTypes {
}

process {
$Request = [System.UriBuilder]"https://api.atlassian.com/jsm/insight/workspace/$InsightWorkspaceID/v$Version/config/statustype/"
if ($objectSchemaId) {
$Request = [System.UriBuilder]"https://api.atlassian.com/jsm/insight/workspace/$InsightWorkspaceID/v$Version/config/statustype/?objectSchemaId=$objectSchemaId"
}
else {
$Request = [System.UriBuilder]"https://api.atlassian.com/jsm/insight/workspace/$InsightWorkspaceID/v$Version/config/statustype/"
}
}

end {
try {
$response = Invoke-RestMethod -Uri $Request.Uri -Headers $headers -Method GET
}
catch {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed"
Write-Error -Message "$($_.Exception.Message)" -ErrorId $_.Exception.Code -Category InvalidOperation
}

$response

Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete"
Invoke-RestMethod -Uri $Request.Uri -Headers $headers -Method GET
}
}

0 comments on commit ae1e6ff

Please sign in to comment.