2

我正在尝试获取 JIRA 问题的附件。但是 getAttachments() 方法返回 null。JIRA 版本为 v6.1.4

下面是代码

final JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
final URI jiraServerUri = new URI("http://XXX-jira.YYY.com");
final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "XXXX", "YYYY");
//final NullProgressMonitor pm = new NullProgressMonitor();
final Issue issue = restClient.getIssueClient().getIssue("XXX-35238").claim();

System.out.println(issue);
System.out.println(issue.getAttachments());

以下是maven依赖项

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client</artifactId>
    <version>2.0.0-m2</version>
</dependency>
    <dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-api</artifactId>
    <version>2.0.0-m25</version>
</dependency>
<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-plugin</artifactId>
    <version>2.0.0-m25</version>
</dependency>
<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-core</artifactId>
    <version>2.0.0-m25</version>
</dependency>

非常感谢您的帮助。

4

1 回答 1

2

“附件”字段必须在“默认屏幕”中可用。否则附件将不会包含在响应中(尽管在浏览器中查看问题时它们是可见的......)

于 2014-07-20T16:26:21.193 回答