プロジェクト

全般

プロフィール

Vote #75649

未完了

Unable to submit time entries via REST API for activities that have become project-specific

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

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

0%

予定工数:
category_id:
32
version_id:
0
issue_org_id:
18095
author_id:
113177
assigned_to_id:
0
comments:
2
status_id:
9
tracker_id:
1
plus1:
1
affected_version:
closed_on:
affected_version_id:
84
ステータス-->[Confirmed]

説明

Steps to reproduce: Create a new project. In web interface, go to "Settings" tab, then go to "Activities (time tracking)" tab. Deactivate an activity (let's say "Design") by unchecking the checkbox. Click "Save". Then reactivate the activity by re-checking the checkbox. Click "Save".

At this point, there is a project-specific activity for the "Design" activity in the Redmine database, in addition to the system-level "Design" activity. So the first question could be: is this a bug? Should the project-specific activity no longer exist when it has been reactivated? For the moment, I'll assume that it is reasonable that it continues to exist.

So, now I make a request to the REST API to get an enumeration of the time entry activities (GET /enumerations/time_entry_activities.xml). It returns only the system-level time entry activities.

However, if I use the web interface to submit a time entry on the "Design" activity for my project via the web interface, it uses the project-specific ID for the time entry.

This inconsistency between the behavior exposed via the REST API and the web interface means that I'm unable to submit time entries via the REST API for project-specific activities, because the REST API does not give me the IDs of those activities.

In order to resolve the bug, I would propose to modify the code that adds time entries in order to converts a system-level time entry activity ID to the corresponding project-specific time entry activity ID if it exists. I've attached a proposed patch.

For reference, here is the output of ruby script/about:

Environment:
  Redmine version                2.5.2.devel.13434
  Ruby version                   1.8.7-p352 (2011-06-30) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Subversion                     1.6.11
  Git                            1.7.1
  Filesystem
Redmine plugins:
  no plugin installed

journals

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

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

いいね!0
いいね!0