Comments (7)
Try to formulate it better please. Your question makes no sence.
from redmine_custom_workflows.
Thx for replying me fast
I want use your plugin to execute in custom table plugin
https://github.com/frywer/custom_tables
But I can't find the value or treat with it
If I need custom field from the table there and write the code
from redmine_custom_workflows.
Hi,
Use this code to get the custom table values:
CustomValue.where(:customized_id => self.custom_entity_ids,:customized_type =>'CustomEntity').detect {|v| v.custom_field.external_name == "Threat"}.try(:value)
You should change the "Threat" word to you table column name! This is the external name of custom_field as below picture shown:
The result of above code is:
1.1 Airborne particles/dust; Levegőben lévő részecskék/por
All rows with ";" separation.
I hope it helps!
from redmine_custom_workflows.
im try this code
if self.custom_field_value(536) != self.custom_value_for(536).try(&:value) || self.custom_field_value(537) != self.custom_value_for(537).try(&:value)
@aa = CustomValue.where(:customized_id => self.custom_entity_ids,:customized_type =>'CustomEntity').detect {|v| v.custom_field.external_name == "AA"}.try(:value)
@bb = CustomValue.where(:customized_id => self.custom_entity_ids,:customized_type =>'CustomEntity').detect {|v| v.custom_field.external_name == "BB"}.try(:value)
@combination_exists = !(@aa & @bb).empty?
errors.add(:base,"This combination is exists!") if @combination_exists
end
but not working
if u can help where the wrong
@AirTibu
from redmine_custom_workflows.
The problem is, that the code I wrote give you back string and you try to compare as array.
from redmine_custom_workflows.
Ok what the correct code
@AirTibu
from redmine_custom_workflows.
Hi,
This code gives back array, what you can compare with other array:
@aa = CustomValue.joins("LEFT JOIN custom_fields ON custom_fields.id = custom_values.custom_field_id").where(custom_values: { customized_id:self.custom_entity_ids,customized_type:'CustomEntity'}, custom_fields: { name: 'AA'}).pluck(:value)
@bb = CustomValue.joins("LEFT JOIN custom_fields ON custom_fields.id = custom_values.custom_field_id").where(custom_values: { customized_id:self.custom_entity_ids,customized_type:'CustomEntity'}, custom_fields: { name: 'BB'}).pluck(:value)
errors.add(:base,"This combination is exists!") unless (@aa & @bb).empty?
I hope it helps!
from redmine_custom_workflows.
Related Issues (20)
- Can i handle global attributes for specific issues? HOT 1
- change status id depend in def function for level in issue HOT 3
- rake task with custom workflow HOT 3
- Script to switch status HOT 1
- Set custom filed only when issue is created, not changed HOT 1
- Access custom field data HOT 2
- float value HOT 1
- Interference with other redmine-plugins HOT 7
- sum depend in the tow custom filed HOT 18
- Problem with upgrading from 2.0.3 to 2.0.9 HOT 1
- pulk value from contacts redmineup plugin
- Actions possible on new tickets HOT 2
- get Post call value before_save using params[:id] HOT 4
- get the last value and last update value in custom field HOT 3
- Mail sending from custom workflows HOT 2
- Help needed with custom_field date type HOT 4
- Send mail to the author when an issue is created HOT 3
- Help! HOT 2
- Assign anotther tracker to quto created subtask HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redmine_custom_workflows.