0
1

Redmineプラグイン開発

Last updated at Posted at 2023-05-24

いま一番興味があるのは、RedmineからAPIでCHATGPTを呼び出す検討だ。
https://qiita.com/EasyCording/items/6c19c718ec4e4c752a80

いろいろ使えると思うが、とりあえずインターフェイスとしてはやはりプラグイン実装は避けて通れない。

いままでRubyはオワコンと思い、ずっと勉強を避けてきたが、CHATGPTに頼れば、すぐにできるかもしれない → 今ここ

プラグインを作りたい

How to create ruby on rails redmine plugin which can post from redmine to API on chatgpt?

To create a Redmine plugin that can post to an API on ChatGPT, you can follow these general steps:

Create a new Redmine plugin using the redmine_plugin_generator command:
rails generate redmine_plugin <plugin_name>

In your plugin's directory, add a new controller class that will handle posts to the ChatGPT API. The controller should inherit from ApplicationController and define a method that sends a POST request to the ChatGPT API with the desired message payload.
For example:

class ChatGptPostController < ApplicationController
  def post_to_chatgpt
    uri = URI.parse("https://api.chatgpt.com/post")
    message = "Hello from Redmine!"
    Net::HTTP.post_form(uri, 'message' => message)
  end
end

Add a new route to your config/routes.rb file that maps to your ChatGptPostController action. For example:

match 'chatgpt_post', :to => 'chat_gpt_post#post_to_chatgpt', :via => [:get, :post]

In your Redmine view or template, add a form that will post to the chatgpt_post route when submitted. For example:

<%= form_tag chatgpt_post_path do %>
  <%= submit_tag "Send to ChatGPT" %>
<% end %>

Test your plugin by starting up your Redmine server (rails server) and submitting the form to post to the ChatGPT API. You should see the message you sent appear in the ChatGPT interface.

Note that this is just a general guide to get you started, and there may be additional configuration or customization steps required based on the specific requirements of your Redmine plugin and ChatGPT API.

今後の予定

 とりあえず全体の流れをつかんだ。後は細かいところを調べつつ、少しずつやっていく。
→ 一番怖いのは、インストール失敗でRedmineがぶっ壊れること

 本番環境ではやらないようにしよう

参考

  • Redmineに関連する記事
  1. 仕事で使うREMINEに関する考察(19)
  2. WIKI一発記入 仕事で使うREDMINEに関する考察(18)
  3. CHATGPTにてRedmine view customizerのHTML要素を生成する(4)
  4. チケット運用の盲点 仕事で使うREDMINEに関する考察(17)
  5. CHATGPTにてRedmine view customizerのHTML要素を生成する(3)
  6. CHATGPTにてRedmine view customizerのHTML要素を生成する(2)
  7. CHATGPTにてRedmine view customizerのHTML要素を生成する(1)
  8. CHATGPT便りの開発方針 仕事で使うREDMINEに関する考察(16)
  9. チケットからTODO作業へ落とし込み 仕事で使うREDMINEに関する考察(15)
  10. 仕事で使うREDMINEに関する考察(14)
  11. CHATGPT利活用 仕事で使うREDMINEに関する考察(12)
  12. やりたいことを少しずつ 仕事で使うREDMINEに関する考察(11)
  13. 組織を巻き込むプレゼン資料 仕事で使うREDMINEに関する考察(10)
  14. OfficeのフローにREDMINEをねじ込む 仕事で使うREDMINEに関する考察(9)
  15. RedmineチケットにCHATGPTを実装(超簡単)
  16. RedmineのチケットにCHATGPTを実装(2)
  17. Office365からRedmineへのメール送信してチケット登録
  18. Redmineプラグイン開発
  19. RedmineをTODOリストに使う 仕事で使うREDMINEに関する考察(8)
  20. 仕事で使うREDMINEに関する考察(7)
  21. 仕事で使うREDMINEに関する考察(6)
  22. 仕事で使うREDMINEに関する考察(5)
  23. 仕事で使うREDMINEに関する考察(4)
  24. 仕事で使うREDMINEに関する考察(3)
  25. 仕事で使うREDMINEに関する考察(2)
  26. 仕事で使うREDMINEに関する考察
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1