Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to add a banner to just the login screen using ScriptRunner

We've switched to SSO and wanted to add a message to the login screen telling them to contact an Admin if they see that screen. I am the JIRA administrator but don't have access to the JIRA server to edit pages so I had to figure out a way to do it through scriptrunner.

I added a web panel but the problem was that the many of the webpanel locations are not displayed on the login page so I had to add a banner a the top of the page but only display it for the login screen. So if you are in the same boat, here's how to do it for Jira v7.

  • Admin -> Add Ons -> Script Fragment
  • Add New Item -> Show a Web Panel
  • Location: atl.header
  • Condition: 
import com.atlassian.jira.plugin.webfragment.model.JiraHelper

JiraHelper jirahelper = new JiraHelper();
def url = jiraHelper.getRequest().getRequestURL().toString();

if (url.contains('login')) {
return 1
} else {
return 0
}
  •  Provider class/script:
writer.write("<div style='background-color: yellow; text-align: center'>" +
"If you are trying to access this page please contact your systems administrator. </div>")

 

Hope that helps!

Kira

1 answer

This is exactly what I need. I gave this a try, but I'm not seeing anything on my login page. After saving the fragment, did you have to take any additional action for this to display on the login page?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

163 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you