Closed ashrafalzyoud closed 4 years ago
@AirTibu if u can help me
Hi,
Add this code to BEFORE SAVE section:
if self.custom_field_value(10).present? && !self.closed?
case
when (self.custom_field_value(10).to_date - Date.today).to_i < 0
@issue.priority_id=(3)
when(self.custom_field_value(10).to_date - Date.today).to_i <= 7
@issue.priority_id=(2)
else
@issue.priority_id=(1)
end
end
Have a nice day!
when issue closed not working i need it change issue.priority_id=(1)
Hi,
Could you please explain what does it mean: "when issue closed not working"?
The issue close should work, if the workflow allow to the user to close the issue.
i mean if the issue still active not closed issue.priority_id=(3) high when the issue closed ( state.id= 4 closed) must change @issue.priority_id=(1) low
.self.closed_on => date.today --> @issue.priority_id=(1) low
Hi,
Ok, I understand. You need this code:
if self.custom_field_value(10).present? && !self.closed?
case
when (self.custom_field_value(10).to_date - Date.today).to_i < 0
@issue.priority_id=(3)
when(self.custom_field_value(10).to_date - Date.today).to_i <= 7
@issue.priority_id=(2)
else
@issue.priority_id=(1)
end
elsif self.closing?
@issue.priority_id=(1)
end
thx for u brother another question plz how i can update all my issue becuase i need reopen issue by issue to effect formula are there formula to update all my issue in one command
im searching i found this formula
namespace :computed_custom_field do
def save_issue(issue, user) issue.init_journal(user) issue.children.each { |i| save_issue(i, user) } issue.reload issue.save! end
task :recalculate => :environment do if ENV['project_id'].present? projects = Project.where id: ENV['project_id'] else projects = Project.active end user = User.find ENV['user_id'] projects.each do |project| project.issues.where(parent_id: nil).each { |i| save_issue(i, user) } end end end
Hi,
Use bulk edit to update issues. Select all issues on issue list screen and right click, then Edit. Do not change anything, just click to submit button on bottom of page.
Approximately 300 issues can be modified at one time.
I have more than 5000 issues Can I use corntab in rake ???
See this site
https://github.com/annikoff/redmine_plugin_computed_custom_field/issues/22
But I don't know how use corntab I'm try
This task must be daily every morning because date now
Hi,
Maybe this plugin helps you:
Redmine Periodic Task: https://github.com/jperelli/Redmine-Periodic-Task
its not working this plugin see this link --> https://github.com/annikoff/redmine_plugin_computed_custom_field/issues/22 im try in crontab in ubuntu and this file in rakeFILE BUT ITS NOT WORKING ( 23 cd /home/redmine/4.1 && RAILS_ENV=production rake computed_custom_field:recalculate user_id=1)
Hi,
I can’t help you on this topic, because my company’s IT department handle this part of redmine, I don’t know the folder structure and plugin installation steps.
Are you sure, that the rake file in the right folder?
According to the description, it should be here: plugins/computed_custom_field/lib/tasks/recalculate.rake
i need formula if cfs [10] type date if (date.today - cfs [10] ) result=> 7 days set --> enumerations =1 (low) if (date.today - cfs [10] ) result=(0-7 days) set --> enumerations =1 (normal) if (date.today - cfs [10] ) result=<0 days set ---> enumerations =2 (high) when issue close set --->enumerations= 1 ( low )