Actions
Rest api with java » History » Revision 12
« Previous |
Revision 12/19
(diff)
| Next »
Chris Maiden, 2012-10-01 18:57
Updated package, see https://github.com/taskadapter/redmine-java-api/issues/41
Using the REST API with Java¶
Redmine Java API library is a FREE third-party Java library that can be used to access the Redmine API. It is released under Apache 2 open-source license.
Sample usage:
import java.io.IOException; import java.net.URISyntaxException; import java.util.List; import com.taskadapter.redmineapi.RedmineManager; import com.taskadapter.redmineapi.bean.Issue; public class Simple { private static String redmineHost = "https://www.hostedredmine.com"; private static String apiAccessKey = "a3221bfcef5750219bd0a2df69519416dba17fc9"; private static String projectKey = "taskconnector-test"; private static Integer queryId = null; // any public static void main(String[] args) { RedmineManager mgr = new RedmineManager(redmineHost, apiAccessKey); try { tryGetIssues(mgr); } catch (Exception e) { e.printStackTrace(); } } private static void tryGetIssues(RedmineManager mgr) throws Exception { List<Issue> issues = mgr.getIssues(projectKey, queryId); for (Issue issue : issues) { System.out.println(issue.toString()); } } }
Create Issue:
Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);
Get issue by ID:
Issue issue = mgr.getIssueById(123);
Updated by Chris Maiden about 12 years ago · 12 revisions