You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm attempting to create a new Jira issue using the powershell code below and I keep getting the error at the bottom. I can't seam to find what I'm doing wrong.
$cred = mycredential
set-jiraconfigserver -Server "https://myserver.atlassian.net"
get-jiraissue -Issue "DEV-251" -Credential $cred
Get-JiraIssueCreateMetadata -Project DEV -IssueType Task -Credential $cred | ? {$_.Required -eq $true}
#customfield_10029 = @{self=https://myserver.atlassian.net/rest/api/2/customFieldOption/10231; value=DatabaseQueue; id=10231},
$fields = @{
'components' = (
'Century Distribution Systems, Inc.'
)
'customfield_10029' = (
id=1023
)
}
New-JiraIssue -Project "DEV" -IssueType "Task" -Summary "Test for backup automation" -Description "Test for backup automation" -Reporter "creffner@cds-net.com" -Labels "Maintenance:Refactoring" -Parent "DEV-2062" -Credential $cred -Fields $fields -verbose
error returned:
Invoke-JiraMethod :
components customfield_10029
---------- -----------------
Specify the value for components in an array Specify a valid 'id' or 'name' for Department
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.9.0\JiraPS.psm1:3603 char:27
+ if ($result = Invoke-JiraMethod @parameter) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
+ FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-JiraMethod
I can see from the output of get-jiraissuecreatemetadata that customfield_10029 is the Department field. and I"m using one of the ids that is returned as an allowed value.
Id : customfield_10029
Required : True
AllowedValues : {@{self=https://myserver.atlassian.net/rest/api/2/customFieldOption/10228; value=BIOperations; id=10228},
@{self=https://myserver.atlassian.net/rest/api/2/customFieldOption/10232; value=DatabaseRelease; id=10232},
@{self=https://myserver.atlassian.net/rest/api/2/customFieldOption/10231; value=DatabaseQueue; id=10231},
@{self=https://myserver.atlassian.net/rest/api/2/customFieldOption/10049; value=DataWarehouse; id=10049}...}
Operations : set
HasDefaultValue : False
Name : Department
Schema : @{type=option; custom=com.atlassian.jira.plugin.system.customfieldtypes:select; customId=10029}
key : customfield_10029
Hi @Christopher - Did you ever get this sorted out? Can you provide what you ended up doing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.