Forums

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

checking the field value during the transition

Marat May 21, 2019

Hi 

I'm trying to create Script Condition. I have several fields (x, y, z,) and I need the transition to be available at certain values.

x == null and y == 1 and z == 1.

3 answers

0 votes
Marat May 21, 2019

I need something like this

 

if cfValues['y'] == 1 && cfValues['z'] == 1 {
passesCondition = false
}

passesCondition = cfValues['x'] is empty
0 votes
Payne
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.
May 21, 2019

Sounds like you should be able to use the "Simple Scripted Condition" offered by Scriptrunner. If x, y, and z are system fields, then you should be able to do something like

issue.x == null && issue.y == 1 && issue.z == 1

or, if they're custom fields, 

cfValues['x'] == null && cfValues['y'] == 1 && cfValues['z'] == 1

Marat May 21, 2019

Hi Payne Seal

I will add a little condition. For example, I have custom fields x, y, z. If the x field is empty, then the transition is available. But if the field x is empty and the fields y, z are not empty, then the transition is not available.

Can you help me?

Payne
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.
May 22, 2019

Sounds like they all need to be empty for the transition to be available, in which case you can use:

cfValues['x'] == null && cfValues['y'] == null && cfValues['z'] == null

0 votes
Zoi Raskou
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.
May 21, 2019

Hi Marat, 

If you are using Scriptrunner you can add a validator in your transition. 

As far as I know there aren't any native features that allow field checks before transitioning. 

Suggest an answer

Log in or Sign up to answer