- CMDB
- Ticketing
New since version 2.4
When an object is going from a source state to a destination state using a transition,
you can define which fields need to be documented (mandatory
), changed (must_change
)
or just proposed (must_prompt
) in the transition form
Flags must_change
, must prompt
and mandatory
set on a state, applies to all transitions ending on that state.
For example, on a Ticket we have 3 different transitions ending on assigned
state:
assign
transition, you want to prompt the user for a mandatory agent
(default behavior of all transitions before 2.4)re-assign
transition, you want to force the agent
to be changed, (possible in XML since 2.4 only)re-open
transition performed on the portal, the agent
field should not even be displayed (possible in Enhanced Portal since 2.4 only)assigned
state, agent
should be in read-only mode in the Ticket modify form, otherwise a change of agent would not trigger the actions associated with the transition, such as a notification email to the new agent for example)profiles
allowed to run that transition. Example n°2, how to configure it in the XML
<class id="UserRequest"> <lifecycle> <states> <state id="assigned"> <transitions> <transition id="ev_reassign"> <target>assigned</target> <flags> <attribute id="agent_id"> <must_change/> </attribute> <attribute id="team_id"> <must_prompt/> </attribute> </flags> </transition>
Transition forms on the console are automatically built based on flags defined on the Datamodel. On the Portal, automatic form can be overwritten, with the exception of empty mandatory field which cannot be removed.
For each field of the object, iTop combines all flags set on the transition and flags Must_xxx
and Mandatory
defined
on the final state (and ignores any other final state flags such as hidden
, read_only
, read_write
).
Checks flags in this order and stops after first match:
must_change
: display in edit mode, value must be changed and different from previous one.must_prompt
: display in edit mode.mandatory
on final state or on transition and initial value is empty: display in edit mode.read_only
on the transition: display the field in read-only mode. Form Validation:
mandatory
flag on transition, on final state or on field definition, then : force field to be documentedcaselog
during a transition,
require to use the flag mandatory
on that transition. Must change
does not force any entry on caselog
Must Change
force that field to be changed on the console (no effect on the portal)Must Prompt
no effect neither on the console nor on the portal.Enhanced Portal now support to define specific forms by transition if you need.
<form id="ticket-reopen" _delta="define"> <class>UserRequest</class> <fields/> <twig> <div> <div class="form_field" data-field-id="public_log" data-field-flags="mandatory"/> <div class="form_field" data-field-id="team_id" data-field-flags="hidden"></div> <div class="form_field" data-field-id="agent_id" data-field-flags="hidden"></div> </div> </twig> <modes> <mode id="apply_stimulus"> <stimuli> <stimulus id="ev_reopen"/> </stimuli> </mode> </modes> </form>
As for any other form defined in the portal, you can set flags on a field to:
<div class="form_field" data-field-id="xxxxx" data-field-flags="hidden"/>
<div class="form_field" data-field-id="xxxxx" data-field-flags="mandatory"/>