在jenkins中使用jira-steps-plugin填充自定义字段失败,并显示“在父选项对象中找不到有效的'id'或'value'

问题描述

我在pkg类型的Jira中配置了一个自定义字段Select List (single choice)

custom "Select List (single choice)" field in jira

我想使用jira-steps-plugin并按如下方式创建一个问题,并使用给定的文本(而不是条目的ID)来归档自定义字段,所以类似这样的

String pkg = "Maven"
customfield_15207: value: pkg,

更多上下文

newJiraIssue = [fields:
                [ project:
                    [key: jiraProjectKey],summary: issueTitle,description: summary,customfield_15207: pkg,issuetype: [name: jiraIssueType]
                ]]

withEnv(["JIRA_SITE=${jiraSite}"]) {
    try {
        String response = jiraNewIssue issue: jiraIssue
        jiraIssueKey = response.data.key
        println "[INFO] ### issue created: ${jiraIssueKey} "
        if (isDebug) {
            echo response.data.toString()
        }
    } catch (Exception e) {
        println("[ERROR] Error creating jira Issue\n${e.getMessage()}")
        throw e
    }
}

不幸的是,这失败了

Error Code: 400
Error Message: {"errorMessages":[],"errors":{"customfield_15207":"Could not find valid 'id' or 'value' in the Parent Option object."}}

我尝试过的其他选项,结果相同

String pkg = "Maven"
customfield_15207: [ value: pkg ],

String pkg = "Maven"
customfield_15207: [[ value: pkg ]],

String pkg = "Maven"
customfield_15207: [ name: pkg ],

我该如何实现?我想念什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)