public/api-v2/worklog/Invoke-JiraGetWorklogsById.ps1
$JiraWorklogExpand = @("properties") #https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-worklog-list-post function Invoke-JiraGetWorklogsById { [CmdletBinding()] param ( # An array of worklog IDs [Parameter(Mandatory,Position=0)] [ValidateScript({ $_.Count -le 1000 })] [int32[]] $WorklogIds, # Used to expand additional attributes [Parameter(Position=1)] [ValidateScript({ Compare-StringArraySubset $JiraWorklogExpand $_ })] [string[]] $Expand, # The JiraContext object to use for the request [Parameter()] [JiraContext] $JiraContext ) process { $functionPath = "/rest/api/2/worklog/list" $verb = "POST" $query = New-Object RestMethodQueryParams if($PSBoundParameters.ContainsKey("Expand")){$query.Add("expand",$Expand -join ",")} $body = New-Object RestMethodJsonBody @{ ids = $WorklogIds } $method = New-Object BodyRestMethod @($functionPath,$verb,$query,$body) $method.Invoke($JiraContext) } } |