无法在custom_field上执行搜索JIRA-Python

问题描述

在custom_field上搜索时出现以下错误

{"errorMessages":["Field \'customfield_10029\' does not exist or you do not have permission to view it."],"warningMessages":[]}
  • 但是我有足够的权限(管理员)可以访问该字段。而且我还启用了可见字段。

URL ='https://xyz.atlassian.net/rest/api/2/search?jql=status=“ In + Progress” + and + customfield_10029 = 125&fields = id,key,status'

解决方法

JQL搜索中的自定义字段使用缩写“ cf”引用,其ID放在方括号“ [id]”中,因此您的URL为:

URL = 'https://xyz.atlassian.net/rest/api/2/search?jql=status=“ In + Progress” + and + cf [10029] = 125&fields = id,key,status'

请确保使用您语言的编码方法正确编码UTF-8格式的方括号。

PS。一般来说,在JQL搜索中按名称而不是ID引用自定义字段要容易得多。它使搜索URL更易于阅读和理解要搜索的内容。