please help how to show banner popup outage details incident

Swati k1
Tera Contributor

Kindly help me on  show outage popup on incident form ,i have created businessrule to create Outage record 

 

1. Open up a new Incident, fill out all needed form fields, and click Save.
2. Modify the Impact and Urgency so that Priority = 1 - Critical or 2 - High. Click Save.
3. A banner at the top of the incident is visible that says:

Outage #[Outage Number] has been created for [Configuration Item] since this is a [Priority] incident.

4. Scroll down to the Related Lists area and to the Outage tab. Click on the Outage tab.

2 REPLIES 2

Hemanth M1
Giga Sage
Giga Sage

Hi @Swati k1 ,

 

Please follow below steps:

1)Create a formatter : ssytem UI >Fomatter > create new as below:

HemanthM1_0-1705830300659.png

2)Create ui macro as below: system UI> UI Macros

HemanthM1_1-1705830370830.png

UI macro name should match with Formatter name

3)add below code to fetch the incident and outage deatails using jelly script:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_elements" jelly="true" object="true">
				var gr = new GlideRecord("incident");
				gr.addQuery("table", current.sys_class_name);
				gr.addQuery("number", current.number);
				gr.addQuery("priority", "1");
				gr.query();
				if(gr.next()){
					//get outage number
					var out = new GlideRecord("task_outage");
					if(out.get("task", gr.sys_id))
					var number = "Outage:"+" "+out.outage.number+" "+"has been created for:"+" "+ gr.cmdb_ci.getDisplayValue()+" "+ "since this is a:" + " "+gr.priority.getDisplayValue()+" "+ "incident:"+" "+gr.number;
				}
			</g2:evaluate>
			 <h3 style="color:red;">$[number]</h3>
</j:jelly>

 

You can adjust the logic if field names are different

4)Add this fomtter to the incident form

open incident form and configure >Form design >add the formatter on the top of the form

HemanthM1_2-1705830561231.png

 

5)Output:

HemanthM1_3-1705830595871.png

 

 

Hope this helps.

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hemanth M1
Giga Sage
Giga Sage

Hi @Swati k1 ,

 

did my response help you? if so,

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025