I've attempted to use Scriptrunner to warn users when their e-mail is set to a dummy value.
To solve this problem I've created a Custom Script Listener that listens for UserAuthenticatedEvent and runs a script that has the following code:
import com.onresolve.scriptrunner.runner.util.UserMessageUtil
UserMessageUtil.success("This is a test message.")
But I never see any messages. Is there something I'm doing wrong or is there a better way of getting a message to a user that can't receive e-mails?
I think the necessary javascript resources that UserMessageUtil likely leverage are probably not available in the initial context after login.
This Util class was intended to be called from workflows and issue related events.
You could make a feature suggestion to adaptavist for them to expand the context where this component is exposed.
You could use scriptrunner script fragments to insert a message in the header:
Location: atl.header (or somewhere else ... you can play around with location context)
Key: something unique for you
menu text: nothing
weight: nothing
condition:
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
user.emailAddress == "yourDefaultEmail@domain.com"
script:
writer.write('<div style="background-color: yellow">Your profile still has a dummy email address. Update it from the profile menu.</div>')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.