Giter Site home page Giter Site logo

sarmad_computed_custom_field's Introduction

ComputedCustomField plugin for Redmine

Build Status Code Climate


Disclaimer

If you need help with a formula's code read FAQ and check out existing issues or ask Redmine community, please do not create issues, this kind of issues will be closed. Please report only about bugs and feature requests.


Description:

This plugin provides a possibility to create a computed custom field. The value of computed field can be set by formula. In formula constructions like cfs[cf_id] are replaced by IDs of custom fields. Valid formula is a valid Ruby code executed when customized object is updated. To put a field ID in the formula, double-click on an item in the list of available fields.

ComputedCustomField plugin for Redmine

Changelog:

Plugin's changelog is available here.

Important information

This is a new version of the plugin. Since version 1.0.0 it is not compatible with previous versions. The following constructions in formula %{cf_id} are no longer supported. Instead use cfs[cf_id]. If you need to upgrade from older versions, please check out migration section.

Notes:

  • cfs[cf_id] โ€” must be an ID of existing custom field.
  • Be careful with code in formula, if it would wrong your application can be crashed.
  • If a computed custom field was created after creating of customized object you need to re-save an object to evaluate computations.
  • After updating of formula customized objects should be re-saved.

Installation:

Clone from GitHub

# Latest version
git clone https://github.com/annikoff/redmine_plugin_computed_custom_field.git computed_custom_field

Or download ZIP-archive and extract it into "computed_custom_field" directory.

Run migrations

rake redmine:plugins:migrate

Migration:

  • Navigate to plugin folder.
  • Run git pull
  • Run rake redmine:plugins:migrate
  • In computed CF's formulas replace %{cf_id} constructions by cfs[cf_id].

Compatibility

The plugins supports the following Redmine versions: 4.0.x, 3.4.x, 3.3.x, 3.2.x, 3.1.x, 3.0.x, 2.6.x, 2.5.x.

Examples:

cfs[1]*2+cfs[2]
# means
# custom_field_value(1) * 2 + custom_field_value(2)
(cfs[1]/3.14).round(2)
if cfs[1].zero?
 cfs[2]/2
else
 cfs[3]/2
end
# For IssueCustomField
(self.estimated_hours || 0) * 2
# For ProjectCustomField
self.parent_id == 2
# If format of Custom Field is Link
"/projects/#{self.project_id.to_s}/issues/new?issue[subject]=Review+request+[##{self.id.to_s} #{self.subject}]&issue[tracker_id]=3"
# Retrieve a value from Key/value list custom field
cfs[1].try(:id)

To write formulas this documentation can be helpful:

Licensed under the MIT-LICENSE

sarmad_computed_custom_field's People

Contributors

annikoff avatar modiamir avatar swiehr avatar aceccarelli avatar a-lapkov avatar ecanuto avatar archonwang avatar plotterie avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.