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.
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
}
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.