Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Condition on editing issue details

Daniel Juravski
Contributor
June 28, 2018

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.

3 answers

1 accepted

0 votes
Answer accepted
Mark Markov
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.
June 28, 2018

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.

Daniel Juravski
Contributor
June 28, 2018

Hi, I have those add-on's, the problem is that I don't know WHERE to write those scripts.

Mark Markov
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.
June 28, 2018

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()
}
}
Daniel Juravski
Contributor
June 28, 2018

Great ! It Works ! thank you.

Mark Markov
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.
June 28, 2018

You re welcome!

If it helps you, please mark answer as accepted :)

0 votes
Prashant Mali
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.
June 28, 2018

Hi @Daniel Juravski ,

You have to write simple script validator on transition to check values of two fields. 

thanks,

Prashant

0 votes
Alexey Matveev
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.
June 28, 2018

Hello,

You would need an add-on for it. For example, Power Scripts (Live Fields) or ScriptRunner (Behaviours)

Daniel Juravski
Contributor
June 28, 2018

OK, but where I write that script ? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events