Function Get-JIRAExtract { Param( [Parameter( Mandatory=$true, HelpMessage="JIRA id of the user")] [string]$assigneeId, [Parameter( Mandatory=$true, HelpMessage="Name of user.")] [string]$assigneeName, [Parameter( Mandatory=$false, HelpMessage="Target Folder.")] [string]$targetFolder = "c:\temp2" ) try { $token = "xxx" $pair = "fname.lname@company.com:$token" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $basicAuthValue = "Basic $base64" $headers = @{ Authorization = $basicAuthValue } $url = "https://mycompany.atlassian.net/rest/api/3/search?maxResults=1000&jql=assignee%20in%20($assigneeId)AND created >= -24w AND status in ('Complete', 'In Progress', 'Resolved', 'Closed')" Write-Host "Call url $url" $json = Invoke-RestMethod -Uri $url -Method Get -Headers $headers...