Python-JIRA-修改标签 [英] Python - JIRA - Modify Labels

查看:970
本文介绍了Python-JIRA-修改标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新/修改JIRA问题标签时遇到问题.

Having an issue updating / modifying a JIRA issue's labels.

我从jira模块文档中尝试了以下两种变体:

I've tried both of the below variations from the jira module documentation:

issue.update(labels=['AAA', 'BBB'])

OR

issue.fields.labels.append(u'new_text')
issue.update(fields={"labels": issue.fields.labels})

文档

在上一个示例中,我遇到此错误:

With the last example I'm getting this error:

JIRAError: JiraError HTTP 400
text: Field 'labels' cannot be set. It is not on the appropriate screen, or unknown.
url: https://jira.XXXXXXXXXX.com/rest/api/2/issue/XXXXXXXX
response text = {"errorMessages":[],"errors":{"labels":"Field 'labels'
 cannot be set. It is not on the appropriate screen, or unknown."}}

有人有什么建议吗?

规格:

Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
jira (0.50)
'rest_api_version': u'2'

推荐答案

好吧,我写了一些jira-python文档,所以我知道它可以工作.作为错误它不在适当的屏幕上"的问题表明,标准的标签"字段不在您的编辑屏幕"配置中,或者已隐藏在项目所使用的字段配置中.确认您可以先通过用户界面编辑标签"字段.

Well, I wrote that bit of the jira-python docs so I know it works. The problem as the error "It is not on the appropriate screen" suggests is that the standard Labels field is not on your Edit Screen configuration, or has been hidden in the field configuration being used by the project. Check you can edit the Labels field via the UI first.

这篇关于Python-JIRA-修改标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆