使用REST与Java客户端通信Jira
我一直在阅读有关Atlassian Jira的页面中的文档.
I have been reading the documentation that is in the page about Atlassian Jira.
我只想在Eclipse中创建一个类以使用Rest连接到Jira并获取问题的名称.
I want to simply create a class in Eclipse to connect to Jira using Rest and get the name of an issue.
我需要安装什么?我下载了此页面的一罐.
What do I need to install? I downloaded a jar of this page.
第一个解决方案
如果您使用的是Eclipse,那就简单了. 下载m2e插件(帮助->安装新软件->使用->"
First solution
If you are using Eclipse than it is simple. Download the m2e plugin (Help -> Install new software --> Work with --> "m2e plugin download link").
然后新建->项目...-> Maven项目 在pom.xml中添加:
Then New -> Project ... -> Maven Project In pom.xml add:
<dependencies>
...
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client</artifactId>
<version>Version of the library you use</version>
</dependency>
...
</dependencies>
并使用> https://studio.atlassian.com/wiki所需的内容/display/JRJC/Tutorial .
或者,如果您唯一需要获取问题名称,则可以向REST URL发出HttpRequest并解析返回的JSON. REST响应的样子: https://jira.atlassian.com /rest/api/latest/issue/JRA-9
Or, if your only need is to get the issues name then you can make an HttpRequest to the REST url and parse the returned JSON. How a REST response looks like: https://jira.atlassian.com/rest/api/latest/issue/JRA-9
请参阅: 如何在Java中发送HTTP请求? , 用Java解码JSON格式