Skip Navigation LinksALVAO 11.2Extension modulesALVAO Service Desk Custom AppsCustom ticket approval form Skip Navigation Links.


Skip Navigation LinksALVAO 11.2 / Extension modules / ALVAO Service Desk Custom Apps / Custom ticket approval form

Custom ticket approval form

The Alvao WebApp ticket approval/rejection form can be replaced by a custom form with specific content and behavior. The custom form allows the approver to set some of the ticket items and thus allows support for more complex approval schemes. Custom forms are not available for ALVAO SaaS.

Templates for creating custom forms can be found in the \Custom\Templates\Approval in the Alvao WebApp installation folder.

Preparing a new form

Copy the sample form - Approval folder to the Approval folder Custom\<functionality name>. Rename both the .cshtml and .cs files contained in the folder so that the name matches the meaning or functionality of the form.

Note:
A general description for setting up custom forms is described in the instructions for Custom form for submitting a new ticket.

Form behavior definition

The description of the behavior is in the .cs file. In the code, comments indicate areas that are intended for modification. Do not interfere with other parts of the code! The most important thing here is ticket approval. In the file there is already an example of approval and rejection of a ticket according to which you can make your own modifications.
The basic structure of the ticket approval/rejection commands is as follows:

TicketApprovalAccept(iHdTicketId, "Ticket approved:<br>"+ MessageBody);
TicketApprovalReject(iHdTicketId, "Ticket denied:<br>"+ MessageBody);

Where MessageBody is the already prepared ticket approval/denial text that was created by converting the form content to text. If necessary, text concatenation can be used in all items as shown in the example. To insert line breaks into the actual text, use the <br> tag.

Note:

If the "StringField" element is not used on the form, which can be used to enter text in HTML format, use the string \n for line breaks.
To access the values of custom fields, use the following structure (example for items "NewName" and "NewNumber"):

string newName = ((ColumnsControl)Model.ColumnsControl["ColumnsControl0"]).Values.Find(Col => Col.Column.sColumn == "NewName").Value as string;
int newNumber = (int)((ColumnsControl)Model.ColumnsControl["ColumnsControl0"]).Values.Find(Col => Col.Column.sColumn == "NewNumber").Value;
Note:

If you want to approve the current step, prematurely terminate approval with it, and skip any subsequent steps in the running approval scheme, use the following structure:

TicketApprovalAcceptAndFinish(iHdTicketId, "Ticket Approved:<br>"+ MessageBody);

Connecting the form to the application

In Administration - Service Desk - Approval Schemes select the schema you want to edit. Use the Edit command in the Approval Steps block to open a window to edit the approval step. In the Custom Form (URL) entry enter the URL of the created form (in the same format as used in the Service - Edit - New Ticket Submission Form - Form Design - Custom form (URL)).

 

Did not find what you were looking for? Ask our technical support team.