help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

on-change set-field - What's wrong ?


From: Franck ROLLAND
Subject: on-change set-field - What's wrong ?
Date: Wed, 27 Sep 2006 17:53:55 +0200

In my dbconfig file I have:

 

field "State" {

    builtin-name "state"

    description "The current state of the PR"

    enumerated-in-file {

            path "states"

            fields { "state" "type" "description" }

            key "state"

    }

    textsearch

 

    on-change {

            # Add Audit-Trail entries when this field changes.

            add-audit-trail

            # Require that a reason be supplied when this field is edited.

            require-change-reason

    }

 

#

# Here's an example of how we would set the Closed-Date: field when the

# State: field is changed to "closed".

#

# Note that a \ followed by a newline is ignored, and \n within strings

# is translated to the EOL character.

#

# Only do the edit if the new State's type is "closed" and if

#    a) the previous State wasn't of type closed

# or b) the Closed-Date is not yet defined

# With this rule, we keep the Closed-Date if we change from a "closed"

# state to another "closed" state.

#

    on-change "State[type]==\"closed\" \

              & (oldpr:State[Type]!=\"closed\" | Closed-Date==\"\")" {

#

#          Set the Closed-Date field to the current date.  (We can also

#       use $OldValue and $NewValue here as well, in addition to any

#       of the PR's field values.)

#

            set-field "Closed-Date" {

                "%s"

                "$CurrentDate"

            }

    }

 

#

# If the new PR's State: field type is not closed...then we want to clear

# the Closed-Date field.

#

    on-change "State[type]!=\"closed\"" {

            #

            # Null it out.

            #

            set-field "Closed-Date" {

                ""

            }

    }

 

#

# If the PR is reopened (feedback -> open or feedback-> analyzed) then we want to clear

# the Version-Fixed field

#

    on-change "State[type]==\"open\"" {

            set-field "Version-Fixed" {

                ""

            }

    }

 

    on-change "State[type]==\"analyzed\"" {

            set-field "Version-Fixed" {

                "%s"

                "$CurrentDate"

            }

    }

 

}

 

field "Version-Fixed" {

    description "Version number where the PR was fixed (feedback)"

    text

    query-default inexact-regexp

    textsearch

}

 

 

When the state of the PR is changed to open, the field Version-Fixed is not cleared.

Why?

What’s wrong?

 

Thanks for your help.

________________________________

 

Franck ROLLAND

________________________________

 

Les informations contenues dans ce courrier électronique sont confidentielles et peuvent être protégées légalement. Elles ne sont destinées qu'au(x) destinataire(s). L'accès à ce courrier électronique par toute autre personne n'est pas autorisé. Si vous n'êtes pas le destinataire voulu, toute divulgation, copie ou diffusion de ce courrier électronique est interdite et peut être illégale. Si vous avez reçu ce courrier électronique par erreur, merci de m’en informer par mail ou par téléphone et de l’effacer de votre système informatique. Merci.

The information contained in this electronic message is PRIVILEGED and confidential information intended only for the use of the individual entity or entities named as recipient or recipients. If the reader is not the intended recipient, be hereby notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by electronic mail or by telephone and permanently delete this message from your computer system. Thank you.

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]