0

I'm trying to use the redmine shared api plugin in order to use the redmine rest API but in a way that exposes sprints and not only the issues that the redmine API returns.

Anyway, I installed the redmine shared api plugin in my locally installed redmine. Now I'm trying to use the paths written in the routes file of the plugin to list the projects that I created in redmine but it returns nothing. It says No content.

I don't know if I'm making any sense because I don't really understand what I'm doing because I'm new to this.

Can anyone try to explain it to me because I can't find enough documentation on the use of this plugin.

UPDATE: Redmine Information

  Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.7.1-p83 (2020-03-31) [x86_64-linux]
  Rails version                  6.0.3.2
  Environment                    development
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Mercurial                      4.8.2
  Git                            2.20.1
  Filesystem                     
Redmine plugins:
  redmine_shared_api             0.0.9
Lyzard Kyng
  • 1,518
  • 1
  • 9
  • 14
  • Did you try the non-authorized (public) path `/public/settings.json` ? – Lyzard Kyng Jul 16 '20 at 05:09
  • Yes I did and it still returns nothing..I think the problem is that the plugin isn't accessing the database but when I run " bundle exec rake db:migrate redmine:plugins:migrate RAILS_ENV=production " it returns an error.. – Chams Akrout Jul 16 '20 at 07:26
  • This plugin doesn't require any migrations, so if you have an error it may indicate some issues with your installation. Did you try [built-in REST endpoints](https://www.redmine.org/projects/redmine/wiki/Rest_api)? – Lyzard Kyng Jul 16 '20 at 07:39
  • The installation works fine..even the shared/projects path works when I added a web service displaying a simple string.. What I don't get is that when I created a project and I can see it in the database and I have access to it via /projects but when I use /shared/projects nothing comes up !! What am I doing wrong ? – Chams Akrout Jul 16 '20 at 07:53
  • When I started running Redmine locally it didn't want to run at first because this function : " def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[]) cached(key, [name, prefix, partial], details, locals) do if (details[:formats] & [:xml, :json]).any? details = details.dup details[:formats] = details[:formats].dup + [:api] end find_templates(name, prefix, partial, details,locals) " kept returning an error so I commented it and everything worked just fine except now for the plugin.. could that be the reason ??? – Chams Akrout Jul 16 '20 at 08:13
  • Yes, commenting this out effectively excludes `.api`-formatted templates from `ActionView` response template lookup. – Lyzard Kyng Jul 16 '20 at 08:33
  • Yes I figured as much ..It's just that I don't seem to find an answer to this error that it's returning it says that " NotImplementedError (Subclasses must implement a find_templates(name, prefix, partial, details, locals = []) method) " I don't know if there is anything that I should add to the controllers to get rid of this error ?? – Chams Akrout Jul 16 '20 at 08:40
  • Please update your question with `Redmine -> Administration -> Information` output – Lyzard Kyng Jul 16 '20 at 08:49
  • Please I really need help in this..I don't really get what I'm supposed to do and the documentation on this plugin and on this whole subject is so scarce!!! – Chams Akrout Jul 16 '20 at 10:20
  • Redmine 4.1 is intended to run on Rails 5.2, but you have Rails 6.0. Please use officially recommended environment. – Lyzard Kyng Jul 16 '20 at 10:36
  • Thank you thank youu you saved my day ..I have just one more thing that I don't get is the files stored in the folder view of the plugin there is a file for every api_controller named " index.api.rsb " and I don't understand the code written in this kind of files and can I add a POST request to add a new sprint for exemple?? the syntax is really new and strange to me.. – Chams Akrout Jul 16 '20 at 11:05
  • `.api.rsb` files has special syntax that's not documented AFAIK, but you can master it by existing examples. There is no _sprints_ in vanilla Redmine. You can write custom plugin for that purpose and surely you can add there ability to POST sprints through your shiny new API. Maybe you'll find some plugin making sprints available and customize it to support API requests. – Lyzard Kyng Jul 16 '20 at 13:18
  • Thank you.. I don't really want to create a brand new plugin I just want to modify the shared redmine api plugin and add a sprints_api_controller and models.. I think I can do that right ? – Chams Akrout Jul 16 '20 at 13:31
  • It doesn't work this way. First, you'll make models, controllers, views, etc to achieve the functionality that you want, and only then you'll add the API layer to access this functionality. – Lyzard Kyng Jul 17 '20 at 06:39
  • Yes I did all that and it works fine :D Thank you so much for your help! – Chams Akrout Jul 17 '20 at 07:38

0 Answers0