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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

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

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 Marketplace Apps & Integrations

Bitbucket Smart Commits vs. Genius Commits - What's the difference?

If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...

114 views 0 2
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