Feature #22026
openConditional custom fields
Added by Anh Le Giang over 8 years ago. Updated almost 2 years ago.
0%
Description
Like the very old topic below, I'd like to request "Conditional custom fields" feature for Redmine custom field, especially Issue object type.
conditional custom fields?
Example: Since we are mobile game developer, we have Device OS field which is a select custom field with value: Android, iOS, Windows Phone. And we have the sub fields OS version (Or even some fields like: Android version, iOS version and Windows Phone version). When reporter selects Android, the OS version field will be enable (show) with a list of version (could be text field or select field): 5.0, 5.1, 6.0, 4.4, etc.
Ref:
https://d1eipm3vz40hy0.cloudfront.net/images/p-apps-marketplace/apps/19078/screenshot-1.png
https://www.zendesk.com/apps/conditional-fields/
Thanks.
Files
Captura de tela 2021-01-11 112113.png (27.1 KB) Captura de tela 2021-01-11 112113.png | BEFORE PLUGIN | Roberto Mendes, 2021-01-11 15:41 | |
Captura de tela 2021-01-11 111951.png (12.6 KB) Captura de tela 2021-01-11 111951.png | AFTER PLUGIN | Roberto Mendes, 2021-01-11 15:41 |
Related issues
Updated by Hide MATSUTANI over 8 years ago
Let me introduce that redmine-view-customize plugin could help the requirement.
Please refer to the following blog. (Japanese site)
Updated by Anh Le Giang over 8 years ago
Hide MATSUTANI wrote:
Let me introduce that redmine-view-customize plugin could help the requirement.
Please refer to the following blog. (Japanese site)
Could you please update English?
Updated by Hide MATSUTANI over 8 years ago
Okay, I'll try...
Conditional custom fields can be made by following procedure.
(1) Pre-condition
Custom Fileds cf_1 and cf_2 are defined in your Redmine.
Value lists are defined like follows.
Say, cf_1 is a parent and cf_2 is a child.
- cf_1
- A
- B
- cf_2
- A-1
- A-2
- B-1
- B-2
You will know the parentFieldId and the childFieldId when you check the html source code.
(2) Install redmine-view-customize plugin
cd {RAILS_ROOT}/plugins git clone https://github.com/onozaty/redmine-view-customize.git view_customize cd ../ rake redmine:plugins:migrate RAILS_ENV=production
Note that the target directory name is different from the repository name.
When you finish installing, you can find 'view customize' in your Administration menu.
(3) Select 'view customize', then create 'New view customize' and set as follows:
Type
JavaScript
Path Pattern
/issues/
Code
$(function() {
// Note that you should change these IDs according to your environment.
var parentFieldId = 'issue_custom_field_values_1';
var childFieldId = 'issue_custom_field_values_2';
// define Conditions
var isTarget = function(child, parent) {
// This is a left-hand match sample
return child.text().indexOf(parent.text()) == 0;
}
var narrowChildField = function() {
var parentSelected = $('#' + parentFieldId + ' > option:selected');
$('#' + childFieldId + ' > option').each(function() {
var child = $(this);
if (isTarget(child, parentSelected)) {
child.show();
} else {
child.hide();
}
});
}
narrowChildField();
$('#all_attributes').change(function(e) {
if (e.target.id == parentFieldId) {
narrowChildField();
}
});
var _replaceIssueFormWith = replaceIssueFormWith;
replaceIssueFormWith = function(html){
_replaceIssueFormWith(html);
narrowChildField();
};
});
Then you can get the conditional custom fields.
When you select in the parent as 'A', you can only select 'A-1' or 'A-2' in the child field.
Is this clear?
Original information:
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
https://github.com/onozaty/redmine-view-customize
Updated by Dipan Mehta over 8 years ago
The case listed in the description is indeed very relevant. However, in my view - the most simple yet generic way you can get this done well is to implement feature #6717 and related #9734. You can have list of possible values as a dynamic set based on some other field value. There are many issues related to #6717 which are similar to this one.
Updated by Hide MATSUTANI over 8 years ago
Dipan Mehta wrote:
The case listed in the description is indeed very relevant. However, in my view - the most simple yet generic way you can get this done well is to implement feature #6717 and related #9734. You can have list of possible values as a dynamic set based on some other field value. There are many issues related to #6717 which are similar to this one.
#13143 is the same as #22026. Actually these issues can be merged. My previous post could be a provisional way to achieve the purpose until this feature is formally implemented.
#6717, #9734 are similar to this from a user point of view, but I think they are different because #22026,#13143 actually use a client-side technology, whereas #6717, #9734 are server-side technology.
I feel the client-side technology is better because it should be responsive -- as it is discussed in the #22026
http://railscasts.com/episodes/88-dynamic-select-menus
Updated by Toshi MARUYAMA over 8 years ago
- Related to Feature #6717: Custom list field with dynamic list content added
Updated by Toshi MARUYAMA over 8 years ago
- Related to Feature #9734: Custom field , value list from database query added
Updated by Toshi MARUYAMA over 8 years ago
- Related to Feature #13143: Populate dropdown custom field list based on previous another selection added
Updated by Toshi MARUYAMA about 8 years ago
- Related to Feature #22621: Linked/conditional custom fields added
Updated by Nova Pun over 7 years ago
Where can i find the custom_field_id ? I try to use "3" and "4" from address:
"http://ils.rainbowconcept.com:3000/custom_fields/3/edit" "http://ils.rainbowconcept.com:3000/custom_fields/4/edit"
, but it's no work ! thanks !
Updated by Roberto Tavares about 7 years ago
Hello!
Is it possible to customize project custom fields the same way as issues custom fields? Than I use "/projects/" in the "Path Pattern" field in the plugin... but besides this, where I have to adapt the code?
Thanks a lot!
Hide MATSUTANI wrote:
Okay, I'll try...
Conditional custom fields can be made by following procedure.
(1) Pre-condition
Custom Fileds cf_1 and cf_2 are defined in your Redmine.
Value lists are defined like follows.
Say, cf_1 is a parent and cf_2 is a child.
- cf_1
- A
- B
- cf_2
- A-1
- A-2
- B-1
- B-2
You will know the parentFieldId and the childFieldId when you check the html source code.
(2) Install redmine-view-customize plugin
[...]
Note that the target directory name is different from the repository name.When you finish installing, you can find 'view customize' in your Administration menu.
(3) Select 'view customize', then create 'New view customize' and set as follows:
Type
[...]
Path Pattern
[...]
Code
[...]Then you can get the conditional custom fields.
When you select in the parent as 'A', you can only select 'A-1' or 'A-2' in the child field.Is this clear?
Original information:
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
https://github.com/onozaty/redmine-view-customize
Updated by 膺升 陳 about 7 years ago
Hi all,
We got a problem as below,
After installing the plug-in,we can see "view customize" in Administrator menu,it is fine.
And then we just follow the steps as MATSUTANI mentioned,seems like it cannot work normally.
When we select parent as "A",not only "A-1","A-2" can be selected but also "B-1" and "B-2".
Could anyone give us a favor?Thanks in advanced.
Hide MATSUTANI wrote:
Okay, I'll try...
Conditional custom fields can be made by following procedure.
(1) Pre-condition
Custom Fileds cf_1 and cf_2 are defined in your Redmine.
Value lists are defined like follows.
Say, cf_1 is a parent and cf_2 is a child.
- cf_1
- A
- B
- cf_2
- A-1
- A-2
- B-1
- B-2
You will know the parentFieldId and the childFieldId when you check the html source code.
(2) Install redmine-view-customize plugin
[...]
Note that the target directory name is different from the repository name.When you finish installing, you can find 'view customize' in your Administration menu.
(3) Select 'view customize', then create 'New view customize' and set as follows:
Type
[...]
Path Pattern
[...]
Code
[...]Then you can get the conditional custom fields.
When you select in the parent as 'A', you can only select 'A-1' or 'A-2' in the child field.Is this clear?
Original information:
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
https://github.com/onozaty/redmine-view-customize
Updated by chris k about 7 years ago
Hi,
only for custom fields it works??? Thnx
Hide MATSUTANI wrote:
Okay, I'll try...
Conditional custom fields can be made by following procedure.
(1) Pre-condition
Custom Fileds cf_1 and cf_2 are defined in your Redmine.
Value lists are defined like follows.
Say, cf_1 is a parent and cf_2 is a child.
- cf_1
- A
- B
- cf_2
- A-1
- A-2
- B-1
- B-2
You will know the parentFieldId and the childFieldId when you check the html source code.
(2) Install redmine-view-customize plugin
[...]
Note that the target directory name is different from the repository name.When you finish installing, you can find 'view customize' in your Administration menu.
(3) Select 'view customize', then create 'New view customize' and set as follows:
Type
[...]
Path Pattern
[...]
Code
[...]Then you can get the conditional custom fields.
When you select in the parent as 'A', you can only select 'A-1' or 'A-2' in the child field.Is this clear?
Original information:
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
https://github.com/onozaty/redmine-view-customize
Updated by Aleksandar Pavic over 6 years ago
+1 for this feature.
Conditional custom fields (maybe per issue category), or have some different parent-child relation for custom fields.
Updated by Darwin Pou almost 6 years ago
+1 for this feature. For example, I would like to look for in my customers database or Rest Webapi in order fill read-only text fields.
i.e.
Document Type: Hard List. Legal Id, Personal Document Id, etc.
Document: 00112760122
My webapi could return Name, LastName and use Redmine to complete this information in the form.
Updated by Fer nando over 5 years ago
Is there any progress on the Father-Son fields?
Updated by Bernhard Rohloff almost 5 years ago
- Related to Feature #32178: Conditioned Custom Fields added
Updated by Roberto Mendes over 3 years ago
Working Perfectly!!! Thanks a lot!!!! \o/
Updated by Roberto Mendes over 3 years ago
Updated by Roberto Mendes over 3 years ago
Updated by Roberto Mendes over 3 years ago
Thanks MATSUTANI!!!
Hide MATSUTANI wrote:
Okay, I'll try...
Conditional custom fields can be made by following procedure.
(1) Pre-condition
Custom Fileds cf_1 and cf_2 are defined in your Redmine.
Value lists are defined like follows.
Say, cf_1 is a parent and cf_2 is a child.
- cf_1
- A
- B
- cf_2
- A-1
- A-2
- B-1
- B-2
You will know the parentFieldId and the childFieldId when you check the html source code.
(2) Install redmine-view-customize plugin
[...]
Note that the target directory name is different from the repository name.When you finish installing, you can find 'view customize' in your Administration menu.
(3) Select 'view customize', then create 'New view customize' and set as follows:
Type
[...]
Path Pattern
[...]
Code
[...]Then you can get the conditional custom fields.
When you select in the parent as 'A', you can only select 'A-1' or 'A-2' in the child field.Is this clear?
Original information:
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
https://github.com/onozaty/redmine-view-customize