プロジェクト

全般

プロフィール

Vote #77188

完了

Associated Revision API

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
152
issue_org_id:
22008
author_id:
144503
assigned_to_id:
332
comments:
6
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Hi I need to check the commit details for specific issue, where we check these through Associated revision is it possible to do it through api


journals

Created an API to add/remove related issues to the revision. I attached a patch.

<pre><code class="diff">
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 269bc70a0..92a145c3a 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -35,6 +35,7 @@ class RepositoriesController < ApplicationController
before_action :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_action :authorize
accept_rss_auth :revisions
+ accept_api_auth :add_related_issue, :remove_related_issue

rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed

@@ -227,8 +228,14 @@ class RepositoriesController < ApplicationController
@issue = nil
end

- if @issue
- @changeset.issues << @issue
+ respond_to do |format|
+ if @issue
+ @changeset.issues << @issue
+ format.api { render_api_ok }
+ else
+ format.api { render_api_errors "#{l(:label_issue)} #{l('activerecord.errors.messages.invalid')}" }
+ end
+ format.js
end
end

@@ -239,6 +246,10 @@ class RepositoriesController < ApplicationController
if @issue
@changeset.issues.delete(@issue)
end
+ respond_to do |format|
+ format.api { render_api_ok }
+ format.js
+ end
end

def diff
</code></pre>

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The Ruby team also needs this feature. Thay applies a similar patch to https://bugs.ruby-lang.org/. See "their repository":https://github.com/ruby/b.r-l.o/commit/1adaf5e96b40c7139b5f5c388ddaa8f74e8bf459#diff-97b4cd6a6c78bf979a5c16e861f345a5 for details.
--------------------------------------------------------------------------------
Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
Committed the patch. Thank you for your contribution.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,35771,Document 'Repositories Management API' and 'Revisions Add/Delete Related Issues API'

Admin Redmine さんが約4年前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0