Jira Python 自定义字段

Dan*_*ong 2 python jira

我正在编写一个脚本来创建错误。我们有很多自定义字段,但我不知道如何让它们在 python 代码中正常工作。有人可以帮忙解释一下吗?我已阅读了尽可能多的文章,但没有一个解决方案有效。

我的自定义字段名称的一个示例是 customfield_15400,默认值为“NO”。我使用下面的代码得到的错误是:

response text = {"errorMessages":[],"errors":{"customfield_15400":"Could not find valid 'id' or 'value' in the Parent Option object."}}
Run Code Online (Sandbox Code Playgroud)

代码:

    project_dict = {'Aroid':'SA', 'OS':'SC'}
    epic_dict = {'Aroid':'SA-108', 'OS':'SC-3333'}

    for index, row in bugs.iterrows():
        issue = st_jira.create_issue(project= project_dict[row['OS']], \
                            summary= "[UO] QA Issue with '%s' on '%s'" % (row['Event Action'], row['Screen Name']), \
                            issuetype= {'name':'Bug'},\
                            customfield_15400="No"
                            )
Run Code Online (Sandbox Code Playgroud)

oja*_*ius 5

尝试以下操作:

customfield_15400={ 'value' : 'NO' }
Run Code Online (Sandbox Code Playgroud)

您还可以执行以下操作,value_id是 Select Field 中值的 id:

customfield_15400={ 'id' : 'value_id' }
Run Code Online (Sandbox Code Playgroud)

事实上,SelectField 的值是一个对象,由它的值和 ID 来描述。