Hello
On 27.03.2014 14:53, Lukasz Szybalski wrote:
*Plugin 1. When you resolve the ticket as "fixed" or invalid...etc, trac
will take me to next ticket in queue.
I don't know about existing plugins. Possibly a custom
ITicketActionController [1][2] could help. But writing a custom action
controller is not trivial. Check [3] maybe.
I think this code would redirect you to the next ticket:
links = req.chrome.get('links', {})
current = req.href.ticket(ticket.id)
next = links['next']['href'] if 'next' in links else current
req.redirect(next)
You could maybe execute this code in apply_action_side_effects() of a
custom controller after it behaves like the default "set_resolution"
action otherwise.
Plugin 2. When ticket is closed, I would like to copy data to another
system, are there examples on how at "resolved as fixed" status, I can
call some function or code, that I can modify to my needs?
That could maybe be done similar to plugin 1 above. Or maybe a
ITickerChangeListener [4] would be simpler here:
...
def ticket_changed(self, ticket, comment, author, old_values):
if old_values['status'] != 'closed' and ticket['status'] ==
'closed' and ticket['resolution'] == 'fixed':
call_your_function()
...
Plugin 3: Are there any plugins where when I query tickets for owner:me
it will display attachments in the query section,,I'm most interested if
there is a readable preview of every attachment, that I can browse by
either moving the cursor or arrow down. This would help "search" for
item that I'm looking for.
I don't know about plugins or the query section, but I have used some
reports [5] for similar problems. Here are two variations of reports
that should list all attachments of the current user's open tickets:
SELECT t.id as id,
t.summary as summary,
group_concat(a.description,", ") as "file descriptions",
group_concat(a.filename,", ") as files
FROM attachment a
INNER JOIN ticket t
ON a.id == t.id
WHERE a.type=="ticket" AND t.owner = $USER AND t.status IN ('new',
'assigned', 'reopened')
GROUP BY t.id
SELECT a.filename AS id, "attachment" AS _realm,
"ticket" AS _parent_realm, t.id AS _parent_id,
a.description as description,
a.size as size,
"#" || t.id || " " || t.summary as __group__,
'../ticket/' || t.id as __grouplink__
FROM attachment a
INNER JOIN ticket t
ON a.id == t.id
WHERE a.type=="ticket" AND t.owner = $USER AND t.status IN ('new',
'assigned', 'reopened')
[1]
http://www.edgewall.org/docs/trac-trunk/epydoc/trac.ticket.api.ITicketActionController-class.html
[2] http://trac.edgewall.org/browser/trunk/sample-plugins/workflow
[3] http://trac-hacks.org/wiki/AdvancedTicketWorkflowPlugin
[4]
http://www.edgewall.org/docs/trac-trunk/epydoc/trac.ticket.api.ITicketChangeListener-class.html
[5] http://trac.edgewall.org/wiki/TracReports
--
Peter
--
You received this message because you are subscribed to the Google Groups "Trac
Users" 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 http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.