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

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

ScriptRunner - UserMessageUtil how to specify time length of pop up message

Hello Community,

I have been exposed to UserMessageUtil function from ScriptRunner.

import com.onresolve.scriptrunner.runner.util.UserMessageUtil

I can make it work successfully, a pop up displays after a certain event, but I am not satisfied with how long the message pops up on the screen.

Is there anyway to set a time-frame for the message to stay on the screen?

Any help is greatly apprecaited!

-Roberto

2 answers

3 votes

This is not quite the "set a time-frame for the message" like you asked... but one option is to set the flag to manual closing.

First, construct your flag using a map. Then call the generic UserMessageUtil.flag method with your flag map as an argument.

def flag = [
type: "warning", //Other possible options are "info", "success", "error"
body: "Please Request for retrofit codes if not already done.",
close: "manual",
]
UserMessageUtil.flag(flag)

 The flag will remain open until the user clicks the x

But that's exactly what OP (and I) don't want, Jira messages dissapear in like 3 seconds or so automatic, I would like to do the same with UserMessageUtil, also close key in flag seems to have changed  to "closeable" and the value to a Boolean instead of "manual".

I can confirm as of ScriptRunner 5.6.11 the above flag map format is still working. For close, use "auto" instead of "manual" and the messages should close automatically after a few seconds like the Jira ones. Without the flags I was having the same problem, messages did not close by themselves by default.

Like Thomas Wohlwend likes this

Currently, there's no way to do this. There is an issue for it in our backlog, which you can vote for / watch.

https://productsupport.adaptavist.com/browse/SRJIRA-1116 

Is it available now?

It is not. That's why the feature request is still marked "TODO".

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

471 views 5 18
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