プロジェクト

全般

プロフィール

Vote #77155

未完了

Change priority depending on the due date

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

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

0%

予定工数:
category_id:
2
version_id:
0
issue_org_id:
21930
author_id:
141915
assigned_to_id:
0
comments:
5
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Hello,

is this possible to automatically change priority of task depending on the due date?

For example:

due date = 10.01.2016

today = 05.01.2016
priority = Normal

today = 08.01.2016
priority = High

today = 08.01.2016
priority = Urgent


journals

Sorry,

today = 10.01.2016
priority = Urgent
--------------------------------------------------------------------------------
Hi, I'm interesting about this features.. I have the 2.3.0 version on my server and this could be a important plugin if exists.

At the moment I can extract priority/start date/due date and I change the priority with a sql script... but this isn't the better way for me!!

Thanks
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
...would be better with a "RoR layer" but you can create a daily mysql event with:

<code class="sql"><pre>CREATE EVENT prio_issues_with_due_date
ON SCHEDULE EVERY 1 DAY
STARTS '2018-06-14 05:00:00'
DO
update issues i
join
issue_statuses s ON s.id = i.status_id
set
priority_id =
case
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.due_date,'%Y-%m-%d')) =-2 and priority_id <= 4 then 4
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.due_date,'%Y-%m-%d')) =-1 and priority_id <= 5 then 5
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.due_date,'%Y-%m-%d')) = 0 and priority_id <= 6 then 6
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.due_date,'%Y-%m-%d')) > 0 and priority_id <= 7 then 7
else priority_id
end
where
s.is_closed = 0
and
i.due_date is not null
;

ALTER EVENT prio_issues_without_due_date
ON SCHEDULE EVERY 1 DAY
STARTS '2018-06-14 05:00:00'
DO
update issues i
join
issue_statuses s ON s.id = i.status_id
set
priority_id =
case
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.created_on,'%Y-%m-%d')) = 1 and priority_id <= 4 then 4
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.created_on,'%Y-%m-%d')) = 2 and priority_id <= 5 then 5
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.created_on,'%Y-%m-%d')) = 3 and priority_id <= 6 then 6
when datediff(date_format(now(),'%Y-%m-%d'), date_format(i.created_on,'%Y-%m-%d')) > 3 and priority_id <= 7 then 7
else priority_id
end
where
s.is_closed = 0
and
i.due_date is null
;
</pre></code>

Remember that there won't be any history.
--------------------------------------------------------------------------------
Changing the priorities directly in the database feels like an evil hack to me. I would rather create a "Redmine Bot" account with elevated privileges and use that account to change the priority of the issues by a script over the REST Api or by a rake task (see reminder emails as example). If the issues priority gets elevated by the bot, it is logged in the issue journal and so it's a documented change by the system. Additionally the bot can add a note about the reason of the change and involved users are getting notified by email.
--------------------------------------------------------------------------------

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

  • カテゴリIssues_2 にセット

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

いいね!0
いいね!0