# Display a dialog box info on login (showcase example in ACE KL May/2022)

**URL:** <https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140>\
**Category:** ScriptRunner\
**Tags:** data-center, jira, script-fragment\
**Created:** [May 17, 2022, 10:42am UTC](https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140 "2022-05-17T10:42:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlim](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/mlim/32/94_2.png) [@mlim](https://forum.library.adaptavist.com/u/mlim)\
**Post date:** [May 17, 2022, 10:42am UTC](https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140/1 "2022-05-17T10:42:33Z")

</div>

This is a showcase example during Atlassian Community Event Kuala Lumpur in [May 2022](https://ace.atlassian.com/events/details/atlassian-kuala-lumpur-presents-build-an-interactive-jira-ui-using-scriptrunner/).

You can display a dialog box for once using ScriptRunner’s Show a web panel fragment. Hopefully, anyone find this useful:

 ![dialog box fragment](https://us1.discourse-cdn.com/flex019/uploads/adaptavistlibrary/original/1X/cfa632b4cba46e2b22ea1f7fa10b99fee738b182.png)

Condition script:

```auto
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.UserPropertyManager
import com.opensymphony.module.propertyset.PropertySet

String newInfoTag = "May 2022 TOS Update"

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

def userPropertyManager = ComponentAccessor.getOSGiComponentInstanceOfType(UserPropertyManager.class);
def userProperty = userPropertyManager.getPropertySet(user)?.getString("Last info box viewed");

if (userProperty != newInfoTag) {
    userPropertyManager.getPropertySet(user).setString("Last info box viewed", newInfoTag);
    return true
}

return false

```

Provider class/script:

```auto
writer.write("""
<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">Updates to Paid Terms of Service</h2>
</header>

<div class="aui-dialog2-content">
<p class="aui-message aui-message-warning">
We’re updating our Paid Terms of Service (“Paid Terms”) to help clarify and make them easier to understand. The Paid Terms apply when you purchase content or services or pay for a subscription.
 
You can review a full summary of the changes and the updated <a href="https://notifications.google.com/g/p/AD-FnEwxdNmqtCdpP4-1Y8MlptmmFnSGobHjuiR62QhaGxvSEh3NJZ0Mx5VS-cgue_wtQgXEkos7yAwDjPI1CliOuORrKAzYs2_pZlnDfY-MfCD1zPY_ywAmbvf-I0Ws_fgzEcg">Paid Terms</a> here.
</p>
</div>
<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-submit-button" class="aui-button aui-button-primary">Okay</button>
</div>
</footer>
</section>
</div>

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

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

function showWelcome() { 
    AJS.dialog2("#demo-dialog").show(); 
}

function dialogClose() { 
    AJS.dialog2("#demo-dialog").hide();
}
</script>
""")

```

---

<div class="post-metadata">

**Author:** ![mlim](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/mlim/32/94_2.png) [@mlim](https://forum.library.adaptavist.com/u/mlim)\
**Post date:** [May 17, 2022, 11:25am UTC](https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140/2 "2022-05-17T11:25:48Z")

</div>

This is the screenshot of the result:

 ![dialog box screenshot](https://us1.discourse-cdn.com/flex019/uploads/adaptavistlibrary/original/1X/be080d63e3598735bebf713ec748a2f1ef494495.png)

---

<div class="post-metadata">

**Author:** ![krishnanayak](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/krishnanayak/32/65_2.png) [@krishnanayak](https://forum.library.adaptavist.com/u/krishnanayak)\
**Post date:** [June 9, 2022, 2:50pm UTC](https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140/3 "2022-06-09T14:50:44Z")

</div>

can this code be used to show the dialog box on-hover of a custom field?

---

<div class="post-metadata">

**Author:** ![mlim](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/mlim/32/94_2.png) [@mlim](https://forum.library.adaptavist.com/u/mlim)\
**Post date:** [July 10, 2022, 5:39pm UTC](https://forum.library.adaptavist.com/t/display-a-dialog-box-info-on-login-showcase-example-in-ace-kl-may-2022/140/4 "2022-07-10T17:39:56Z")

</div>

Sorry for the late reply. No, you can’t unfortunately.
