Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11978 closed task (worksforme)

How to use conditional validation

Reported by: girish Owned by: Ryan J Ollos
Priority: normal Component: DynamicFieldsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

I want to check that certain fields are not blank only for tickets with type enhancement. Can you explain how to do this in trac.ini ?. I tried using the example you have given, nbut it's not working for me.

Attachments (0)

Change History (7)

comment:1 Changed 10 years ago by Ryan J Ollos

Please post the [ticket-custom] configuration you tried.

comment:2 Changed 10 years ago by anonymous

[ticket-custom]
keywords.invalid_if = 
keywords.invalid_when_type = enhancement

I get an error message even if ticket type is defect or anything else. I want keyword field mandatory only for ticket type enhancement.

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 10 years ago by anonymous

Please let me know how to do this

comment:4 Changed 10 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newaccepted

I tested the 0.11 and 0.12 branches with Trac 1.0.2beta1. The configuration you posted in comment:2 works on the 0.11 branch, but not the 0.12 branch. I will try to the issue fixed on the 0.12 branch soon.

comment:5 Changed 10 years ago by Ryan J Ollos

The ValidateRule was added in [10662] and the invalid_when option was added in [11565]. These changesets were added to the 0.11 branch and haven't been merged to the 0.12 branch. I suggest using the 0.11 branch with all version of Trac >= 0.11 for now.

Since the 0.12 branch hasn't been maintained, we should probably just make a new 0.12 branch based on the current HEAD of 0.11, and backport the differences from the existing 0.12 branch.

comment:6 Changed 10 years ago by anonymous

Thanks. I will follow your suggestions and let you know if it is working

comment:7 Changed 10 years ago by Ryan J Ollos

Resolution: worksforme
Status: acceptedclosed

See #12112, and please reopen if you continue to have trouble when installing from the 0.11 branch.

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.