REST API for Redmine : Create an issue in redmine tool from C# code


Config

<appSettings>
<add key=”redmineHost” value=”http://bugs.Xyz.com”/&gt;
<add key=”redmineUser” value=”testuser”/>
<add key=”redmineUserPassword” value=”12345″/>
</appSettings>

Components:

Redmine.Net.Api (http://www.redmine.org/projects/redmine/wiki/Rest_api_with_csharp)  (download: http://code.google.com/p/redmine-net-api/)

Newtonsoft.Json.dll

CODE:

RedmineManager manager = new RedmineManager(Configuration.RedmineHost,Configuration.RedmineUser, Configuration.RedminePassword);

Dictionary<string, int> Projects = new Dictionary<string, int>();

foreach (Project proj in manager.GetObjectList<Project>(new NameValueCollection()))
          Projects.Add(proj.Name, proj.Id);

IList<Issue> issues = manager.GetObjectList<Issue>(new NameValueCollection() { { “project_id”, <<strProjId } });

Reference:

http://www.codeproject.com/Articles/338010/Fun-with-Google-Speech-Recognition-service

Happy Coding ..!!

Advertisements

6 thoughts on “REST API for Redmine : Create an issue in redmine tool from C# code

  1. Hi,

    Saw this article and thought of posting my own problem.

    I have to create a report by accessing redmine data. This report will be a consolidated report of projects for all projects in the redmine database.

    Any ideas on how to do this? A SQL query with the table associations would be a good start. I have setup Redmine on my local system and can access the Redmine database.

    I plan on creating a HTML5 .Net based web application. I would write an IIS service (or maybe a REST) service to fetch data from the Redmine production database.

    Any help/pointers would be deeply appreciated.

    Regards,
    Pranjal

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s