Reset fields for ITSM Change Templates

Moderator: crythias

Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Reset fields for ITSM Change Templates

Post by crythias »

I'm not sure if this should be a HowTo (Probably Yes) but ...

OK, so you're going along trying to test fields in ITSM Change Templates and realized you have to change, for instance, the Template Title and that requires you to also change the required fields on the Edit Screen of the template.
All those pesky required Dynamic Fields, plus Description and Justification now are taunting you, the template creator, to fill them in. Which doesn't play nice with those fields you want to force your users to fill in. Because of course, if you fill them in, they're no longer mandatory to change because they have data.

Yuck.

OK, so for the dynamic fields, at least temporarily, you'll want to turn them to Enabled and not Enabled and Required just so you can reset them to "blank". I know, this breaks some reason for you to do it. If you're in version 6+, make sure you enable as favorites that location for ITSMChangeEdit###DynamicField so you can get back to it quickly to set it to Required when you've saved your Edit.

This leaves Description and Justification. Sorry, you must have something in the Title. Can't be helped. "Change Me" or "Someone was too lazy to replace this title" might be useful. Or not. But we'll fix, temporarily, the other two fields.

And this ... isn't too terribly difficult.
For Description: So you'll want to remove "Mandatory" as a class for the Label:
https://github.com/OTRS/ITSMChangeManag ... dit.tt#L36

Code: Select all

                    <label class="" for="RichText1"><span class="Marker">*</span> [% Translate("Description") | html %]:</label>
And Validate_Required from the textarea:
https://github.com/OTRS/ITSMChangeManag ... dit.tt#L38

Code: Select all

                        <textarea id="RichText1" class="RichText  [% Data.DescriptionInvalid %]" name="Description" rows="15" cols="[% Config("Ticket::Frontend::TextAreaNote") %]">[% Data.Description | html %]</textarea>
Do the same thing for line 44 and 46 (Justification).
You might want to just save and keep this open in the editor, make the change to the Title you want, clear up all the fields, then save your edit (New Title) with blanks for all your formerly known as mandatory fields, revert your changes in the AgentITSMChangeEdit.tt file, and set those DynamicFields back to mandatory. As long as you don't need to update that Edit form anymore, all those fields are now appropriately mandatory and required to fill in and you don't have template cruft populating the fields.

Remember: your code is your responsibility. The above steps might not work for you, but at least mandatory fields start becoming more mandatory again as you create Change Templates.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply