I am using JiraPs in Powershell to attempt to create a new Jira Issue When I run the code below I receive an error saying that the reporter is required. However I am providing a reporter as queried. I have also attempted giving the accountid my admin provided to me in the format XXXXX:XXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
This results in the same error message.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$User = "myuser"
$PWord = ConvertTo-SecureString -String "myAPIID" -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
$reporter = (Get-JiraConfigServer -Server "myserver" -ErrorAction Stop) + "/rest/api/3/user/search?query=" + $user
#$accountId = (Invoke-JiraMethod $reporter).accountId
cls
set-jiraconfigserver -Server "myserver"
$fields = @{
Components = @(
@{value = "company"}
)
customfield_10029 = @{value='DatabaseQueue'}
}
New-JiraIssue -Project "DEV" -IssueType "Sub-Task" -Reporter $accountId -Summary "Test for backup automation" -Description "Test for backup automation" -Labels "Maintenance:Refactoring" -Parent "DEV-251" -Credential $cred -Fields $fields -Debug:$True
How do I retrieve and pass a valid reporter?