Vote #77203
未完了Conditional custom fields
0%
説明
Like the very old topic below, I'd like to request "Conditional custom fields" feature for Redmine custom field, especially Issue object type.
message#15119
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.
journals
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Let me introduce that redmine-view-customize plugin could help the requirement.
Please refer to the following blog. (Japanese site)
http://blog.enjoyxstudy.com/entry/2016/04/03/000000
--------------------------------------------------------------------------------
Hide MATSUTANI wrote:
> Let me introduce that redmine-view-customize plugin could help the requirement.
> Please refer to the following blog. (Japanese site)
>
> http://blog.enjoyxstudy.com/entry/2016/04/03/000000
Could you please update English?
--------------------------------------------------------------------------------
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
<pre>
cd {RAILS_ROOT}/plugins
git clone https://github.com/onozaty/redmine-view-customize.git view_customize
cd ../
rake redmine:plugins:migrate RAILS_ENV=production
</pre>
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*
<pre>
JavaScript
</pre>
*Path Pattern*
<pre>
/issues/
</pre>
*Code*
<pre><code class="js">
$(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();
};
});
</code></pre>
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
--------------------------------------------------------------------------------
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.
Do add related #6717, #9734, #13143.
--------------------------------------------------------------------------------
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.
>
> Do add related #6717, #9734, #13143.
#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
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
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 !
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
+1 for this feature.
Conditional custom fields (maybe per issue category), or have some different parent-child relation for custom fields.
--------------------------------------------------------------------------------
+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.
--------------------------------------------------------------------------------
Is there any progress on the Father-Son fields?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Working Perfectly!!! Thanks a lot!!!! \o/
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
related_issues
relates,New,6717,Custom list field with dynamic list content
relates,New,9734,Custom field , value list from database query
relates,New,13143,Populate dropdown custom field list based on previous another selection
relates,Closed,22621,Linked/conditional custom fields
relates,New,32178,Conditioned Custom Fields