Modify ↓
      
        #3094 closed enhancement (fixed)
A comment addition at the ticket under edit
| Reported by: | anonymous | Owned by: | Eli Carter | 
|---|---|---|---|
| Priority: | normal | Component: | AdvancedTicketWorkflowPlugin | 
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.11 | 
Description
Would you make it add the comment like "duplicated #nn" also to the ticket under edit, although a comment is added to the inputted ticket number?
For example, they are the following touch.
    def get_ticket_changes(self, req, ticket, action):
        """Returns no changes."""
        return {}
Above is source of controller.py of revision 3730 line 380 - 382.
For example, how is correcting as follows?
    def get_ticket_changes(self, req, ticket, action):
        id = 'action_%s_xref' % action
        ticketnum = req.args.get(id).strip('#')
        comment = req.args.get('comment')
        if comment != '':
          comment = comment + '[[br]]\n'
        comment = comment + 'duplicated #%s' % ticketnum
        req.args['comment'] = comment
        return {}
    Attachments (0)
Change History (2)
comment:1 Changed 17 years ago by
| Status: | new → assigned | 
|---|
comment:2 Changed 17 years ago by
| Resolution: | → fixed | 
|---|---|
| Status: | assigned → closed | 
Rough implementation added in r3820.
Note: See
        TracTickets for help on using
        tickets.
    



Reworking your suggestion, I think you'd want something closer to:
def get_ticket_changes(self, req, ticket, action): """Returns no changes, but injects a change into the comment.""" format_string = actions[action].get('xref_local', 'Ticket %s was marked as related to this ticket') if format_string: id = 'action_%s_xref' % action ticketnum = req.args.get(id, '') local_ref = format_string % ticketnum comment = req.args.get('comment', '') if local_ref not in comment: if comment: comment += '\n\n' comment += local_ref + '\n' req.args['comment'] = comment return {}(Completely untested!)
There are a number of problems though...
So I think both sides have to be done in the side-effect stage.