Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I need to validate a field only if the value in another field matches a certain value.

I only have access to Jira Workflow Toolbox and need make sure a field isn't blank but only if another field has a certain selection. 

For example: I need to make sure the location field is not blank if "team a" is selected in another field. 

If "team b" is selected the field could be blank. 

Any thoughts? 

2 answers

1 accepted

Hi @Floyd Goodell,

since you already have Jira Workflow Toolbox you can implement the requested behaviour quite easily:

Add a Boolean validator and adapt the following pseudcode to your request.

%{your team field} = "team a" IMPLIES %{your location field} != null

The field codes have to match the fields you're using, obviously.

I hope that helps. Please let me know, if you need further assistance.

Cheers,
Thorsten

Thank you Thorsten I appreciate it, I was experimenting with Boolean Validators although I hadn't tried "implies". I will have to give it a try.

The problem I ran in to repeatedly is the "Only if" logic ... so anytime I would put in a validator of any kind for that team in that field it would pop the validator when another team was selected as well. For example I want the validator to trigger when finance is the team but not trigger when development is selected... 

Hi @Floyd Goodell,

this is exactly what the function (IMPLIES) is for: if and only if your specific team is selected, then the other field is enforced to be set. So everything should work fine.

If you're experimenting with parser expressions and run JWT 2.4.0 or newer, I'd clearly recommend testing your expressions on the newly added Parser Test Page (see the documentation here: https://apps.decadis.net/display/JWT/Expression+Parser+Test).

You can evaluate your expressions and only deploy the one's to your workflows that are working as expected.

Cheers,
Thorsten

Thank you that makes sense. I will let you know how it goes as soon as I can. 

I really appreciate all the help

@Thorsten Letschert _Decadis AG_ That worked perfectly in test... thank you very much

Fixed a small typo. Obviously it should read != instead of =.

@Thorsten Letschert _Decadis AG_ , I have the same problem mentioned above but when I attempt to use your sample code and replace the {your team field} and {your location field} with my fields I get a script error.  For some reason the Validator does not like the IMPLIES command.

 

 issue.customfield_10002 != null IMPLIES issue.customfield_13432 != null

 

Any ideas?

Hey @Doug Slay ,

could you please - when in doubt - add a screenshot of your configuration? Please ensure, that you're using the correct syntax, especially regarding our field code reference - see https://apps.decadis.net/display/JWTSDC/Field+codes

That said, your expression should probably read:

%{issue.cf10002} != null IMPLIES %{issue.cf13432} != null

 Cheers
Thorsten

Hi Thorsten,

I tried 'IMPLIES'. However, my validator only returns true now... What might this be? If I run the expressions individually, I do get the right results...

my code:

%{issue.cf58002} = "Yes, ticket already exists" IMPLIES (count(linkedIssues("causes")) > 0)

Nevermind, it works as intended! Just confused me in the admin section...

0 votes

Hello Floyd,

Welcome to Atlassian community.

I would like to confirm to you which would be the trigger to perform this validation.  I mean, Should it be performed as soon as the field is filled with team A or team B are filled or in a specific workflow transition?

Also, Are you using JIRA Cloud or Server?

It seems that you would like to perform this validation as soon as your field is filled with team A or B, correct?

If that's the case, you will need a plugin to achieve it. My recommendation would be:

 

1 - Split your workflow in two, configuring two workflow transitions:

One with the proper validator to confirm if the location field is set;

 One with no validators.

 

2 - Install  Automation Lite for JIRA (300 free executions) plugin

 

3 - Configure a new automation rule to trigger when the field is filled with team A or B, transitioning the issue for one of the two created transitions of your workflow

 

We will be waiting for your answer to know if we have properly understood your request and give you more instructions in case you need.

Thank you for your response. Sorry I forgot to include which Jira version and type we are using: Jira server 7.3.6 and Jira service desk 3.5.0.  Ideally this would be triggered on a specific transition. The transition doesn't have to be automated. 

A little more detail... basically in one of our service desks multiple help desk teams and 2nd level teams utilize the workflow... one second level team needs to have a custom field (field is a billing account selection) be anything other than a value of none or "tbd" before moving to a resolution. The rest of the teams don't even utilize the field but I couldn't get any validator available to me to work in a conditional sense (only impacting that team). 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you