【问题标题】:JiraPS PowerShell Module / new-jiraissue issuesJiraPS PowerShell 模块 / new-jiraissue 问题
【发布时间】:2021-11-01 15:59:35
【问题描述】:

我已经看了几个小时了,我正用头撞桌子。

我不断收到此错误:

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

脚本:

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

如果我将-priority 4 添加到我得到的脚本中:

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

我的头撞在桌子上,我的头越来越疼。如有任何建议,我将不胜感激。


不知道为什么我在 cmets 中的格式不固定,但如果其他人偶然发现此问题并需要帮助,有解决方案。

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

【问题讨论】:

  • 删除Priority 参数是否有效?您可以手动创建具有相同字段的 Jira 问题吗?
  • 不,然后它给了我一个数组错误。我刚刚编辑了帖子以显示这一点。

标签: powershell jira jira-rest-api


【解决方案1】:
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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多