This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fda3b56
commit 505706b
Showing
2 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
# https://developer.atlassian.com/cloud/insight/rest/api-group-object/#api-object-id-get | ||
function Get-InsightObject { | ||
[CmdletBinding()] | ||
param ( | ||
[string]$ID, | ||
[String]$Version = "1", | ||
[string]$InsightCreds = $InsightCreds, | ||
[string]$InsightWorkspaceID = $InsightWorkspaceID | ||
) | ||
[CmdletBinding()] | ||
param ( | ||
[string]$ID, | ||
[String]$Version = '1', | ||
[string]$InsightCreds = $InsightCreds, | ||
[string]$InsightWorkspaceID = $InsightWorkspaceID | ||
) | ||
|
||
begin { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" | ||
$Headers = New-InsightHeaders | ||
} | ||
begin { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" | ||
$Headers = New-InsightHeaders | ||
} | ||
|
||
process { | ||
$Request = [System.UriBuilder]"https://api.atlassian.com/jsm/insight/workspace/$InsightWorkspaceID/v$Version/object/$id" | ||
} | ||
process { | ||
$Request = [System.UriBuilder]"https://api.atlassian.com/jsm/insight/workspace/$InsightWorkspaceID/v$Version/object/$id" | ||
} | ||
|
||
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 | ||
} | ||
end { | ||
try { | ||
$response = Invoke-RestMethod -Uri $Request.Uri -Headers $headers -Method GET | ||
} | ||
catch { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed" | ||
Write-Error -Message "$($_.ErrorDetails.Message)" -ErrorId $_.Exception.Code -Category InvalidOperation | ||
} | ||
|
||
$response | ||
$response | ||
|
||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" | ||
} | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" | ||
} | ||
} |