Hi,
I've written a script in jython to validate a transition.
But in error case, when i use description and invalid fields variables, the transition fails but there is no error on concerned fields.
Have you any idea ?
Thanks in advance,
Regards
Thanks for your answer.
I would like to display a clean error message on a failed transition with json script validator.
i use a jython script to validate a transition.
description = "example fields must filled correctly" invalid_fields[cfm.getCustomFieldObjectByName("example")] = u"example fields must filled correctly"
For example, i check if some fields are filled in correctly otherwise i would like to display an error message.
I've seen with JSS plugin (JIRA Scripting Suite) it's possible with jython context variable to display an error message on concerned fields.
The two variables are "description" and "invalid_fields".
Do you understand my problem ?
Thanks
Community moderators have prevented the ability to post new answers.
If the fields are not valid for the project/issuetype, then I suspect it has nothing to fail on. It can't say "this field is wrong" because the field simply isn't there.
But I could be misunderstanding the question and what you're doing. Maybe post the relevant part of the jython (and a note on how you're running it in JIRA might help for context)
Hi,
I want to diplay a JIRA error message if my jython validator script fails.
It is possible and how to do this ?
Thanks in advance,
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know if it's possible, you have not explained how you are running the jython in JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, For a specific workflow, I've added a validator (wrote in jython) for a transition between two states. If this validation fails, i want to display a JIRA message for explain why. My script works fine but the error message displayed when there is an error is not very user friendly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the third time, you need to explain how you are running the jython.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Before you ask, JIRA does NOT allow you to write functions like that, you need to explain how you are running it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I've installed Jira Scripting Suite plugin which allow to put custom conditions, validators, etc.. in workflow with Jython Scripts. In Jython Scripts, I can use python methods and java methods. Currently, for stopping Jython script execution and display errors I use "raise" python method but the message is not very user friendly because it's a Python exception. That's why I would like to use jira api to display error messages when the validator fails.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right, I was going to post, but you found it for yourself. There's no way to do this with some add-ons that allow scripting, and others have totally different methods, so I couldn't really help you. Glad you got there!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've a last question.
conditions scripts are called after all modification or just after the previous transition ?
If i modify a field which condition a transition, available transition will be updated or not ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No! * A condition checks to see if the user can *start* the transition. Effectively, they run whenever you look at an issue in any way that you might be able to move it through the workflow so that JIRA can work out whether to show you the transition, or let you start it. * A validator runs when the user *tries to commit* the transition and checks the data is valid. * A post-function runs when the user *commits* a valid transition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I've found a workarroud to display errors correctly. I use a screen on my transition to display some fields and when i add errors on a field with :
invalid_fields[cfm.getCustomFieldObjectByName("example")] = u"example fields must filled correctly"
Error is correclty displayed on transition.
However, it is possible to associate a screen with transition only on specific issue like a critical issue for example ?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, look at the workflow transitions. Every transition has a "screen" which can be set independently of everything else. One trick to consider in your case here might be to set up a Screen for your critical issues and then have the workflow have *2* slightly different transitions. Let's say you're going from "open" to "in progress" - create two transitions from open to in-progress - on one of them, use your screen - on the other, do not put the screen on it (or use a different one) - on the first transition, place a condition for "Priority = Critical" - on the second, place a condition for "Priority != Critical" The users will only ever see one transition available, and they'll only get your screen on "critical" ones.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.