- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 09:24 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 11:05 AM
Here is a dynamic content block to use as a starting point.
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:
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 10:50 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 11:05 AM
Here is a dynamic content block to use as a starting point.
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:
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2015 11:17 AM
Thanks alot Reed, it worked like a charm. That was a good option that I didn't think of. Much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2016 03:57 AM
Hello
is it possible to apply that on the admin homepage? (not on the ess portal)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 03:16 AM
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.