Service Manager Connection Package - Use Case - Create a Ticket Endpoint

Last modified on 2022/12/14 16:17

From: Service Manager versions Oxygen 2.0 and later.

  To help you set up this use case, you can download the relevant documentation and sample project. Open url.png See List of files to download.

This use case enables you to create a ticket in Service Manager from a Self Help procedure. It uses the createTicket endpoint in the Service Manager connection package.

Overview

The implementation of the use case is performed in several phases:

  • Phase 2: Call the createTicket endpoint (2)
    • Create a sub-procedure associated with the createTicket endpoint.
    • Configure the input and output parameters of the endpoint.

         Use case - Create a ticket procedure.png

Prerequisites

1. Install and configure the Service Manager connection package.

    Open url.png See the procedure.

2. Create a new procedure in your Self Help project.

    Open url.png See How to create a Self Help procedure.

Phase 1: Collect the information required for creating the ticket

    Open url.png See the description of the createTicket endpoint.

    Information to be collected:

  • Ticket catalog code. This can be obtained in three ways:
    • Using the Category metadata of the procedure
    • Using the ticket category code corresponding to Category to qualify
    • Using a form completed by the user
  • Email address of the requestor/recipient, i.e. email address of the logged-in user
  • Description of the ticket, using a form completed by the user
     

Step 1: Create a step called Input data.

1. Insert a Page step in your Self Help procedure.

2. Name it Input data.

Step 2: Retrieve the ticket catalog code.

Note: Use one of the three methods below to retrieve the catalog code.

1. You want to use the Category metadata of the procedure.

  • Display the metadata of your new procedure in the Properties view.
  • Enter the catalog code of the new ticket in the Category metadata.
           Use case - Create a ticket procedure - Category metadata.png
     

2. You want to use the default ticket catalog code.

Note

  • The default catalog code is automatically loaded when you create a ticket without a catalog code. 
  • The connection package is shipped with default catalog code 58 which corresponds to the Get Help category.
  • You can modify the default code using the ezvGetRequestCatCode macro available in the project library.

Modify the default catalog code

  • Expand the tree structure of the connection package.
  • Go to the Project Macros section in the Library folder.
  • Right-click the ezvGetRequestCatCode macro and select Update from the contextual menu.
           Use case - Create a ticket procedure - Update default ticket code.png
  • Enter the new default catalog code.
  • Click Finish.
           Use case - Create a ticket procedure - Enter default ticket code.png
     

3. You want to ask the user to enter the catalog code in a form.

  • Create a new form in your Self Help project.
  • Name it fTicketCreation.
  • Add a Simple choice list of values field.
           Use case - Create a ticket procedure - Create form for ticket code.png
  • Click Create list.
           Use case - Create a ticket procedure - Create form for ticket code - Enter values.png
  • Specify the catalog code values to be proposed to users.
    • Click Add Label/Value.
    • Enter the description of the catalog code in the Label field.
    • Enter the value of the catalog code in the Value field.
  • Click Finish.
     

Step 3: Retrieve the email address of the requestor/recipient.

The email address is automatically retrieved using the email address of the logged-in user.

Caution: Ensure that the email address specified in Self Help is identical to the one specified in Service Manager.

Step 4: Retrieve the description of the ticket.

1. Create a form if you did not create one for obtaining the catalog code. Name it fTicketCreation.

or

Use the fTicketCreation form you created earlier for obtaining the catalog code.

2. Add a text field with multiple lines where users can enter a description.

         Use case - Create a ticket procedure - Create form for ticket description.png

Step 5: Associate the form with the Input data step.

1. Click and drag the fTicketCreation form from the Explorer pane to the Input data step.

Phase 2: Call the createTicket endpoint

Step 1: Create a step for calling the endpoint.

1. Insert a Sub-procedure step in the Self Help procedure. 

2. Double-click the step.
The properties window of the procedure will appear.

3. Select the Link to procedure alias option.
The list of aliases available is displayed.
       Use case - Create a ticket procedure - Alias list.png

4. Select the alias of the createTicket endpoint.

5. Click Next.
The window for configuring input and output parameters will appear.
       Use case - Create a ticket procedure - Alias parameters.png
 

Step 2: Enter the values of the input parameters of the endpoint.

    Note:

  • Specify the values in the Input values column. ==> Fields are displayed in green.
  • Parameters without specified variables are ignored.
  • You can associate raw values with input variables.
    • Caution: Enter the value, surrounded by double quotes.
    • The value will appear in blue.

      example  Example input parameters - pInRequestor via email.png

1. Specify the pInCatCode variable for storing the catalog code, depending on the method you are using to retrieve the catalog code.

  • If you specified the catalog code using the Category metadata of the procedure, leave this variable blank.
           Example input parameters - pInCatCode via metadata or catalog code.png
  • If you used the default catalog code, leave this variable blank.
    Caution: Ensure that the Category metadata of the procedure is not specified.
           Example input parameters - pInCatCode via metadata or catalog code.png
  • If you created a form asking users to enter the catalog code, associate the corresponding form variable.
           Example input parameters - pInCatCode via formulaire.png

2. Specify the pInRequestor and pInRecepient variables for storing the email address of the requestor/recipient.

  • Associate the email address of the user logged in to Self Help. This is found in the predefined variable called executionContext.user.email.

             Example input parameters - pInRequestor via variable.png
           Example input parameters - pInRecepient via variable.png

3. Specify the pInDescription variable for storing the ticket description.

  • Associate the corresponding form variable.
           example  Example input parameters - pInDescription.png
     

Step 3: Enter the values of the output parameters of the endpoint.

    Notes

  • Specifify the values in the Output variables column. ==> Fields are displayed in red.
  • Variables are specific to the current procedure.

1. Select the output parameter.

    Open url.png See the description of output parameters.

2. Enter the name of the associated output variable.

         Use case - Create a ticket procedure - Alias parameters - Output parameters.png

Step 4: Save the step that calls the endpoint.

1. Click Finish.

The step will automatically be renamed createTicket.

Phase 3: Define the conditions of the ticket creation

Step 1: Create a step for adding the creation conditions.

1. Right-click the createTicket step and select Insert a Step > Insert an Action with Switch from the contextual menu.

2. Name the step, Test.
Two branches will be created.

  • The top branch <Condition> manages the response to be provided in the event of failure of the ticket creation.
  • The bottom branch Default manages the response to be provided in the event of success of the ticket creation.

Step 2: Define the condition that represents the failure of the ticket creation.

1. Double-click the <Condition> field in the top branch.
The window for defining the condition will appear.

1. Enter the condition that indicates a creation failure with a negative status of the query.

  • Select the CreateStatus output variable that stores the status of the query.
  • Select the less than operator et enter the value 0.
      Open url.png See the description of return codes.

         Use case - Create a ticket procedure - Output parameters test.png

  • Click Finish.
    The condition will be refreshed.

Phase 4: Process the test result of the ticket creation

Step 1: Process the result in the event of an error.

1. Insert a Page step after the top branch that is called in the event of an error.

2. Name the step, Error.

3. Define the content of the step.

Best Practice icon.png  Click Insert an expression and enter the variable name to retrieve the value of variables.
Use case - Create a ticket procedure - Display value of a variable.png

  • Enter a message informing users that an error occurred.
  • Display the error message using the CreateMessage output variable.
    Caution: The name of the variable is case-sensitive.
     
Self HelpExample
Use case - Create a ticket procedure - Error.pngUse case - Create a ticket procedure - Error - Example.png

Step 2: Process the result in the event of success.

1. Insert a Page step after the bottom branch that is called in the event of success.

2. Name the step, Success.

3. Define the content of the step.

  • Enter a message informing users that the procedure was correctly executed.
  • Display the new ticket number using the CreateResult.ID output variable.
    Caution: The name of the variable is case-sensitive.
     
Self HelpExample
Use case - Create a ticket procedure - Success.pngUse case - Create a ticket procedure - Success - Example.png

List of files to download

Tags:
Powered by XWiki © EasyVista 2022