Opened 4 years ago

Closed 4 years ago

# Use of default rule

Reported by: Owned by: wberry@… robguttman normal DynamicFieldsPlugin normal 0.12

### Description

I want to modify the cc list based on ticket type or component but I'm not sure I understand how to use the entry in the trac.ini file. I've used you example: type.default_value = (pref) cc.default_value = (pref) cc.append = true

If I want to make defect tickets set the cc to test should I do this:

type.default_value = defect cc.default_value = test cc.append = true???

I've tried this and its not working but want to be sure I understand the useage first.

### comment:1 Changed 4 years ago by robguttman

• Status changed from new to assigned

If you want to modify the cc field (or any field) based on another field's value, you will need to use the Set Rule. Your example above for setting the cc field based on ticket type would become:

[ticket-custom]
cc.set_to_myvalue1_when_type = defect
cc.set_to_myvalue2_when_type = test


Note, however, that the Set Rule will not set any value by default if the field already has a value. To overwrite any existing value no matter what, the above would become:

[ticket-custom]
cc.set_to_myvalue1_when_type = defect (overwrite)
cc.set_to_myvalue2_when_type = test (overwrite)


The Set Rule does not do any appending at this time. Please re-open this ticket if this rule does not work for you.

### comment:2 Changed 4 years ago by wberry@…

• Resolution set to worksforme
• Status changed from assigned to closed

Thank you for the explaination. This rule now works correctly, but as you were already expecting it would benefit from the append option. Tickets with a previously populated cc field would probably not want this field overwritten, but appended. I'll open an enhancement ticket for this option.