如何通过 REST API 获取 JIRA 问题的描述、受让人姓名?

How can I get the description,assignee name of a JIRA issue via the REST API?

通常我使用 java 程序在得到 json 响应后使用 jirarestapi.Now 获取 jira 的问题我只能得到密钥。

json响应如下图

现在,通过使用密钥,我想使用这些密钥获取特定 jira 的描述和受让人名称。

您要查找的信息在返回的 JSON 的字段部分。您需要的所有字段都是 jira 标准字段,因此很容易找到。您需要:摘要、描述和受让人。

要限制返回的字段数量,您可以调整 rest 调用。如果您使用 jql 端点,您可以将以下内容添加到请求的末尾:

 &fields=summary,description,assignee

顺便提一句,您的 jira 实例实际上不应包含 2000 多个自定义字段。这对性能来说很糟糕。

希望对您有所帮助。

您的问题的答案已在 Atlassian 论坛上提供,但不完整,但您仍然可以查看它以供您实施。

Atlassian forum query

为了向您简要说明应该做什么,您可以添加一个额外的 JQL 语句来进一步过滤您的 REST 响应。

&fields=description

您可以进一步参考 JIRA 文档 here

fields [string]

Multi-value parameter defining the fields returned for the issue. By default, all fields are returned. Allowed values:

  • all - return all fields.
  • navigable - return navigable fields only.
  • summary,comment - return the summary and comments fields only.
  • comment - return all fields except comments.
  • all,comment - same as above

希望对您有所帮助!