Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Need to create a button i.e., reopen a button when case is closed

Not applicable

I need to create a button through widget. I have a requirement where when a case is closed or incomplete or cancelled. I need to place a button where the user can click it and able to open the reopen the case.can anyone help with this

5 REPLIES 5

Sohail Khilji
Kilo Patron

Hi @Community Alums ,

 

You would need to create a custom button as shown in the below link :

 

https://www.servicenow.com/community/now-platform-articles/reopen-incident-button-on-service-portal-...

https://www.servicenow.com/community/itsm-forum/reopen-incident-option-on-service-portal-for-end-use...

https://www.servicenow.com/community/developer-articles/create-reopen-incident-widget-which-requires...

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

@Sohail Khilji I have tried with above links but it was not working can you please help me with the code

Harish Bainsla
Kilo Patron

Create a UI Action:

Navigate to System Definition > UI Actions in the application navigator.
Click on "New" to create a new UI Action.
Fill in the following information:
Name: Enter a name for your UI Action, e.g., "Reopen Case."
Table: Select the table that corresponds to your cases, e.g., "Incident" for incident cases.
Action name: Enter a unique action name, e.g., "reopen_case."
Client: Check the box for "Client."
Show Insert: Leave this unchecked.
Show Update: Check this box to display the button on the form.
Condition: Define the conditions under which the button should appear. For example, you can use conditions like active==false (for closed cases), state==3 (for canceled cases), or any other conditions that match your requirements.
Script: Enter JavaScript code to perform the reopening of the case

function reopenCase() {
current.state = 2;
current.update();

}

reopenCase();

@Harish Bainsla I need script  on widget not on ui action