Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JiraPS PowerShell Module / new-jiraissue issues

Christopher Huckabee November 1, 2021

I've been looking at this for a few hours and I'm banging my head against the desk.

I keep getting this error:

Invoke-JiraMethod : 
customfield_10806 components
----------------- ----------
Could not find valid 'id' or 'value' in the Parent Option object. data was not an array

Script:

New-JiraSession -Credential $Credentials -Verbose #-Debug
$field = @{
'components' = @{
id = 10303
}
'customfield_10806' = @{
id = 10704
}
}
New-JiraIssue -Project 'PROJECT' -IssueType '4' -Fields $field -Summary "Test Summary Created by $($env:username) in PowerShell" `
-Description "Test Summary Created by $($env:username) in PowerShell" -Reporter 'REPORTER' -Verbose -Confirm:$false

 

If I add "-priority 4" to the script I get:

Invoke-JiraMethod : 
priority
--------
Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.

 

Does anybody have any ideas??

1 answer

1 accepted

1 vote
Answer accepted
Christopher Huckabee November 1, 2021
New-JiraSession -Credential $Credentials -Verbose
$fields = @{
Project = 'PROJECT'
IssueType = 4
Summary = "Test Summary Created by $($env:username) in PowerShell"
Description = "Test Summary Created by $($env:username) in PowerShell"
Reporter = 'REPORTER'
Fields = @{
'customfield_10806' = @{'value' = 'Low'}
Components = @(
@{
name = 'NAME'
})
}
}

New-JiraIssue @Fields -Verbose

Going to go ahead and answer this in case it's helpful for anybody else.

Suggest an answer

Log in or Sign up to answer