Dialog box before login to Jira

To ensure users are presented with a Dialog box to acknowledge it before logging into Jira, we have implemented using Script Runner. We are aware of the KB article Customize Jira login page | Jira | Atlassian Documentation and Atlassian has recorded a Suggestion for their development team https://jira.atlassian.com/browse/JSDSERVER-14682
We wanted more of a Dialog box, where users explicitly acknowledges the message and once acknowledged, it should never show-up.

Script Runner REST End point

import javax.servlet.http.HttpServletRequest
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import com.atlassian.sal.api.user.UserManager

import com.atlassian.jira.user.preferences.UserPreferencesManager
import com.atlassian.core.user.preferences.Preferences

import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate 

    httpMethod: "GET"
) { queryParams, body, HttpServletRequest request ->

    def userManager = ComponentAccessor.getOSGiComponentInstanceOfType(UserManager)
    def userProfile = userManager.getRemoteUser(request)

    if (userProfile) {
        log.warn(userProfile.username + " set properties")
        def user = ComponentAccessor.userManager.getUserByName(userProfile.username)

        String newInfoTag = "Jira Outage Message1" //Setting this value to match with that of Fragment Panel newInfoTag. If this does not match, then the dialog box pops-up for every Jira call

        def userPreferencesManager = ComponentAccessor.getOSGiComponentInstanceOfType(UserPreferencesManager.class);
		 userPreferencesManager.getExtendedPreferences(user).setString("Dialog Box", newInfoTag) //Setting the value of the Key to newInfoTag so that, the message box only shows once per user.

    return Response.ok(new JsonBuilder().toString()).build() 

Script Runner Fragment Web Panel


import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.module.propertyset.PropertySet
import com.atlassian.jira.user.preferences.UserPreferencesManager
import com.atlassian.core.user.preferences.Preferences

String newInfoTag = "Jira Outage Message1" //Setting the initial value

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

def userPreferencesManager = ComponentAccessor.getOSGiComponentInstanceOfType(UserPreferencesManager.class);

def userPreference = userPreferencesManager.getExtendedPreferences(user)?.getString("Dialog Box"); // Setting the Key value of Dialog Box to Null

if (userPreference != newInfoTag) {
    // this will be True for the first time, as newInfoTag will not be equal to UserPreference for the first time. Subsequently in the provider/class script, the REST End point makes it equal and will return false on subsequent Jira calls
    return true

return false

Provider class/script

<body onload="showWelcome()">
<section id="demo-dialog" class="aui-dialog2 aui-dialog2-small aui-layer" data-aui-modal="true" role="dialog" aria-hidden="true">
<header class="aui-dialog2-header">
<h2 class="aui-dialog2-header-main">Enterprise Jira Outage Notification</h2>

<div class="aui-dialog2-content">
<div style="background-color: linen; border: 3px solid darkred; margin: 4px; padding: 2px; text-align: left;">
Enterprise Jira will be down on <strong>10/12/2023 starting at 12:00 p.m. (ET) until 10/16/2023 at approximately 12:00p.m. (ET) </strong>
Please do not login during these times. By clicking the Okay button, you acknowledge that you have read this message.
For information regarding the outage and offline activity guidance, please click
<a style="color:blue;"href="https://google.com>here</a> 


<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-submit-button" class="aui-button aui-button-primary">Okay</button>

var ci = document.getElementById("dialog-submit-button");

if (ci.addEventListener) ci.addEventListener("click", dialogClose, true);

function showWelcome() { 

function dialogClose() { 
    var url = "/rest/scriptrunner/latest/custom/setUserProperties";



The problem we are facing is, every time there is a new message that needs to be acknowledged (for example new outage), we have to change the Key so that the new message is acknowledged. Are there any better solutions available? or any fine-tuning of current solution?