How to display a banner message on the itil login home page?

rev
Kilo Contributor

Hey everyone,

right now I'm trying to display a message on the Itil service now homepage based on the value of a field value on an incident form. I've done some research and so far haven't come up with much. Would anyone be able to point me in the right direction?

Thanks,

Rob

1 ACCEPTED SOLUTION

reedowens
Tera Contributor

Here is a dynamic content block to use as a starting point.



message_jelly.png



Add the Message content block to the spot on the page you want.   I added above the header and this is what it looks like:



result.png



And here is the code to copy:



   
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
   var gr = new GlideRecord('incident');
   gr.addActiveQuery();
   gr.addQuery('priority', '=', '1');
   gr.query();

   var foundIt = false;
   if (gr.hasNext()) foundIt = true;
</g:evaluate>
 
<j:if test="${foundIt}">
   <span class="my-message-class" style="background:red;color:black;">You have a priority 1 Incident</span>
</j:if>
</j:jelly>

View solution in original post

10 REPLIES 10

reedowens
Tera Contributor

Ok.   There are a few ways you can do this:



1) You can make a report that show the options/query that you are interested in


2) You can create a new "List of Content" in CMS.   It's one of the content block types.   That could do the query for you and you can format the response


3) You can use a dynamic block and do the query and kick out any type of information message you want.   If there is no message, then nothing would be displayed as a benefit.     This would be the best solution with the most control.


4) You can use a Static HTML block with you message and make it conditional.   The condition would be a script that checks and sees if Option A was selected.   You would have to make one for each of the conditions you want to check for.


reedowens
Tera Contributor

Here is a dynamic content block to use as a starting point.



message_jelly.png



Add the Message content block to the spot on the page you want.   I added above the header and this is what it looks like:



result.png



And here is the code to copy:



   
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
   var gr = new GlideRecord('incident');
   gr.addActiveQuery();
   gr.addQuery('priority', '=', '1');
   gr.query();

   var foundIt = false;
   if (gr.hasNext()) foundIt = true;
</g:evaluate>
 
<j:if test="${foundIt}">
   <span class="my-message-class" style="background:red;color:black;">You have a priority 1 Incident</span>
</j:if>
</j:jelly>

rev
Kilo Contributor

Thanks alot Reed, it worked like a charm. That was a good option that I didn't think of. Much appreciated.


Hello



is it possible to apply that on the admin homepage? (not on the ess portal)


Hey christophesilva,


have u found any solution if the please help me to have the same issue   to display a info message on home page upon login.