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

Roberto L
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2017

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

4 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 10, 2018

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

Javier Sánchez November 22, 2019

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".

cuong hoang July 29, 2020

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
1 vote
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2017

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 

Roberto L
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2017

@Jonny Carter,

I will vote!

-Roberto

Ankush Dhingan November 26, 2018

Is it available now?

Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events