Show/hide widget based on incident state

Ashwin Perumal1
Tera Contributor

Hello All,

I have created a simple widget that displays a text when user open an incident from portal in my requests page. The below is the HTML code done for displaying text in portal

HTML:

<div class="displaytext">
<h2>{{::options.title}}</h2>
</div>

 I added the widget in required page and in instance option we have title filed where i have entered the required text to display in portal. Attached screenshot below

AshwinPerumal1_1-1717048900936.png


My requirement is to display the text "Display text" only when the Incident state is New. My custom text widget should be hidden when incident state is not new. I tried using Glide Record of incident table in server script and used ng-if directive in html but still I am not able to achieve the required. Can anyone help to achieve this by showing the custom widget based on incident state.

 

Thanks in advance