Thank you for your response.
What I was specifically hoping for was a solution within validate_ticket to
detect that it is a new ticket specifically. I can check req.path_info in
('/newticket') but that doesn't capture new tickets created via the RPC or
other methods.
From: "RjOllos" <[email protected]>
To: "Trac Development" <[email protected]>
Cc: [email protected]
Sent: Friday, March 3, 2017 6:41:10 PM
Subject: [Trac-dev] Re: Question regarding validate ticket on ticket_created
On Friday, March 3, 2017 at 8:14:21 AM UTC-8, Logan Anderson wrote:
Hey guys,
It appears that I can validate fields for a ticket via validate_ticket and if I
use if req.path_info ('/newticket' to detect it from new ticket entry but this
doesn't catch new tickets created in other ways such as via the RPC. Ok, so I
can detect new ticket creation with ticket_created, but this doesn't seem to
allow me to adjust the field values. It seems to trigger after the ticket is
created and doesn't intercept the request allowing me to adjust the fields
before submission.
I hope that makes sense. How do I appropriately detect a *new ticket* and alter
the fields before it is saved as I do with validate_ticket?
I was looking for more info on the req object. Maybe I don't know how to search
for what I want in the API document. Is there something in there which I can
use from within validate_ticket to detect that it is a new ticket (from
whatever source) and avoid making the adjustments for ticket updates?
Thanks,
Logan
You can alter the ticket fields in validate_ticket. As an example you can look
at r11747 for DefaultCcPlugin. Prior to r11747 ITicketChangeListener was used
to append to the CC list, but this resulted in additional entries in the change
history of the ticket. r11747 switched to using ITicketManipulator to append to
the CC list before the ticket is created.
https://trac-hacks.org/changeset/11747
- Ryan
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected] .
To post to this group, send email to [email protected] .
Visit this group at https://groups.google.com/group/trac-dev .
For more options, visit https://groups.google.com/d/optout .
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.