Set state during ticket creation - is this possible?

7 views
Skip to first unread message

Jesper Holm Olsen

unread,
Feb 6, 2012, 3:03:56 AM2/6/12
to Trac Users
I have searched faq's and groups and wiki without being able to find a
solution to this problem.

I have configured a ticket flow where all tickets start out as state
"new", then goes through a series of states and end up as state
"closed". This is pretty standard and well-documented.

My problem is that I would like to be able to set the initial state
when I create the ticket, so that I can set the ticket to ANY state
during ticket creation. There is a plugin that allows me to set a
default state, but that is not enough for me :) Ideally I would like a
drop-down with all the states just as I have a drop-down for the
components during ticket creation.

Any thoughts? Does a plugin exist for this or would I need to hack
trac myself?

Regards,
Jesper

Jesper Holm Olsen

unread,
Feb 9, 2012, 6:14:16 AM2/9/12
to Trac Users
I looked in the file trac/ticket/templates/ticket.html (see code
snippet below) where it looks like I could uncomment a few lines to
also show the "actions" when creating a new ticket.

My question is then: Will this mess up any internal database state if
I set the ticket state upon creation or would this be safe to do?

Regards,
Jesper


<!--! Workflow support -->
<py:if test="ticket.exists"> <!--! do not display the
actions for New tickets -->
<py:choose>
<fieldset py:when="can_append or can_modify"
id="action">
<legend>Action</legend>
<div py:for="key, label, controls, hints in
action_controls">
<input type="radio" id="action_$key"
name="action" value="$key"
checked="${key == action or None}" />
<label for="action_$key">$label</label>
$controls
<span class="hint" py:for="hint in hints">$hint</
span>
</div>
</fieldset>
<py:otherwise>
<py:for each="key, label, controls, hints in
action_controls">
<input py:if="key == action" type="hidden"
name="action" value="$action" />
</py:for>
</py:otherwise>
</py:choose>
Reply all
Reply to author
Forward
0 new messages