Powershell New-JiraIssue returning field required when field value is given

john.krieg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2023

I am using the JiraPS Module in Powershell.  Pseudo Code below:

Get credentials

New-JiraSession

Populate required fields

$field = @{
Components = @(@{name = 'Team' })
customfield_10450 = @{id = '557058:f7' }
customfield_10333 = @{name = 'IT xxx' }
customfield_10361 = @{name = 'REQUESTS' }
reporter = @{id = '557058:f7' }
}

$params = @{
Project = $project
IssueType = $issueType
Summary = $summary
Description = $description
Labels = $labels
Fields = $field
Credential = $credential
errorAction = "stop"
}
if ($field) {
$params.Fields = $field
}
#
try {
Write-Output "Issue can be created:`n$_"
New-JiraIssue @Params
Write-Output "Issue was created:`n$_"
} catch {
Write-Output "Issue cannot be created:`n$_"
}

 

I get the following Error:

PS>TerminatingError(New-JiraIssue): "Jira's metadata for project [ITDBABI] and issue type [Task] specifies that a field is required that was not provided (name=[Reporter], id=[reporter]). Use Get-JiraIssueCreateMetadata for more information."
Issue cannot be created:
Jira's metadata for project [ITDBABI] and issue type [Task] specifies that a field is required that was not provided (name=[Reporter], id=[reporter]). Use Get-JiraIssueCreateMetadata for more information.

Any Help would be greatly appreciated.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events