Hi,
I have on my issue "field1" and "field2" that were created with some values.
When I edit my issue, how can I make a condition that checks if the new value of "field1" is greater than "field2" - and only if it is , I can save my new value ?
Hope I expressed my wish well.
Hello @Daniel Juravski
You cannot do it out of the box.
But you can use some plugins like Scriptrunner, PowerScripts, Jira Suite Utillities and create validator that will check your condition.
Hi, I have those add-on's, the problem is that I don't know WHERE to write those scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In scriptrunner behaviour you can go to add-ons -> behaviours -> add one -> map to your project and issue type -> fields -> add field1 -> add serverside script
and script like this
if (getActionName() == null){ //check that we are on edit screen
def cf1 = getFieldByName("field1")
def cf2 = getFieldByName("field2")
if (cf1.getValue() < cf2.getValue()){
cf1.setError("field1 must be greater than field2")
}
else {
cf1.clearError()
}
}
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 re welcome!
If it helps you, please mark answer as accepted :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daniel Juravski ,
You have to write simple script validator on transition to check values of two fields.
thanks,
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You would need an add-on for it. For example, Power Scripts (Live Fields) or ScriptRunner (Behaviours)
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.