How to show DialogMessage in validator script ?

It's possible ?

I use lfDialogMessage("Message", "ERROR"); and nothing happend

4 answers

1 accepted

Accepted Answer
0 votes

You don't. Validators don't have any interaction with the front-end of Jira. All their code does is return "pass" or "fail and here's a message to put on the screen the user is returned to"

Nic - I think you are thinking of Conditions maybe... Validators allow an error collection which can be general error messages or specific to fields.

However from the "lf" I think this is some client-side aspect of the jjupin plugin.

Nope, definitely validators. Bad prose on my part probably.

Validators either pass, or fail, and when they fail, as you say, they "allow an error collection", which then goes back to the screen that the user is returned to. They don't have anything that lets you do messaging outside that though, so message popups and so-on simply don't have anything to feed into, all you can do is add to the error collection.

I don't know jjupin well enough to be aware of it doing more clever stuff, I've only ever seen it used to write validators that work like that.

OK thanks for tip, I create a screen to display message.

return false, "INFO", "message";

- it's possible to set type of message ? INFO,ERROR, etc. ?

You're missing the point - a validator either passes or fails.

There's no screen to define because it goes back to where it was when the user started the transition, and there's no point in having message levels, the validator just says "failed validation", there's no other information.

Sorry, I have on mind to set screen to transition...

There's a confusion here. I'm afraid I missed this question, and the answer will come a bit late (my bad). You cannot put a LiveFields call on a validator. You can use LF only from LF scripts or hooks and in postfunctions.

What you need is to validate that field client side. This does not absolve you to write the validator itself.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Thursday in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

1,438 views 4 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you