How to create a REOPEN button (Similar to REOPEN INCIDENT button ) in EMPLOYEE CENTER PORTAL

Byron Plant
Tera Contributor

Hi everyone!

 

I need help in creating a REOPEN button in Employee Center portal for a different application (not incident).

 

We recently created a new application using App Engine Studio. The new app is kind of similar to Incident. Now on the Employee Center portal, we want it to have a Reopen button that will only appear if the ticket is in RESOLVED state (similar to Incident). The button should ask for comments first before the ticket can be reopen again. How can I achieve that?

 

See sample image below for reference:

 

REOPEN 1.jpg

 

REOPEN 2.jpg

4 REPLIES 4

Riya Verma
Kilo Sage
Kilo Sage

Hi @Byron Plant ,

 

Hope you are doing great.

 

To create a REOPEN button in the Employee Center portal for your new application, follow these steps:

  1. Open the App Engine Studio and navigate to the application you created, similar to the Incident application.

  2. Within the application, identify the field that represents the ticket status. Let's assume it's called "state."

  3. Create a new button in the Employee Center portal interface. You can achieve this by customizing the portal's UI through Service Portal Designer.

  4. Add a script to control the visibility and behavior of the REOPEN button. This script should execute when the page loads to check if the ticket is in the RESOLVED state. If it is, display the REOPEN button; otherwise, hide it.

 

// Assuming the "state" field represents the ticket status
var ticketStatus = $sp.getValue('state');
var reopenButton = document.getElementById('reopenButton'); // Replace 'reopenButton' with the actual ID of your REOPEN button element

// Check if the ticket is in the RESOLVED state
if (ticketStatus === 'RESOLVED') {
    reopenButton.style.display = 'inline'; // Show the REOPEN button
} else {
    reopenButton.style.display = 'none'; // Hide the REOPEN button
}

// Function to handle the REOPEN button click
function reopenTicket() {
    var comments = prompt('Please provide comments before reopening the ticket:');
    if (comments !== null && comments !== '') {
        // Perform the necessary action to reopen the ticket (update ticket status, log comments, etc.)
        // Replace the following line with the actual code to reopen the ticket:
        alert('Ticket reopened successfully with comments: ' + comments);
    } else {
        // Handle case when comments are not provided
        alert('Comments are required to reopen the ticket.');
    }
}

 

 

 
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

Hi @Riya Verma thank you so much for responding. I'll try this solution and let you know if this works.

@Byron Plant , is this working for you ?

 

 
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

When to apply this BR please : After, Before, display, async ?

Thanks