Hi All,
I have a question about the syntax needed for the validation of forms data for a condition.
As you can see in the image, I have a Forms field (short text) that I am checking to see if it has a value or not. It is the beginning of a condition with lots of other fields after it. If it is empty, I need the rule to stop.
However, I can't get the syntax right to keep it from passing the validation. The field has no value in it for sure, but I have tried some different combinations including Not Equal to Empty and it always passes even through the form field is empty.
Any ideas? Also, creating a custom field and linking it is not an option - I have several other checks in the form that need to be followed or whether they are empty or not as well.
@Bill Sheboy - can ya help a brother out?
Hey,
Have you taken a look at this doc?
From what I can see, you might need to do something like {{forms.last.c4p4-brand}} or potentially {{forms.last.c4p4-brand.label}}
I hope this helps a bit.
that would be my guess as well. interested to see if it works. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would also add that for the Regex part. The word Empty won't work as Regex is very specific. I'd leave it blank and change the second field to to be that it does match the regex.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Heather Ronnebeck - But what I want is it is is not empty or not blank. If you clear it out, it leaves the word Empty in there as a watermark more or less and the description actually shows it as not equal to empty or something along that line. I am suspicious of the regex also but can't find the right syntax there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried outputting the value to the log (both empty and with a value)?
That should give you a direction to work towards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...
I have not found a consistent method to test for "empty" fields in automation rules, as they are impacted by the field type and starting conditions, such as:
As others describe, try writing these to the audit log to learn how to detect empty or not:
forms.size = -->{{forms.size}}<--
forms.last.c4p4-brand = -->{{forms.last.c4p4-brand}}<--
forms.last.c4p4-brand.isEmpty() = -->{{forms.last.c4p4-brand.isEmpty}}<--
forms.last.c4p4-brand.isNotEmpty() = -->{{forms.last.c4p4-brand.isNotEmpty}}<--
forms.last.c4p4-brand.length() = -->{{forms.last.c4p4-brand.length()}}<--
exists(forms.last.c4p4-brand) = -->{{if(exists(forms.last.c4p4-brand), "it exists", "it does not exist")}}<--
and so on...
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John Funk -- did you see this new article on form smart values?
https://community.atlassian.com/t5/Jira-articles/Using-Forms-Smart-Values/ba-p/2888967
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just saw that yesterday, but have not read through it yet. Will try to do that over the weekend. Thanks for sharing it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent article and love the new capabilities! Thanks for sharing @Bill Sheboy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You would need to define what form on the issue to get the value from.
For example the last submitted one would be {{forms.last.c4p4-brand}} and it can only trigger on the Form Submitted trigger (or a manual but then you need the uuid of the form template)
Easiest would be to first output the smartvalue through a log action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's only one form and that syntax works if I am just copying the value of that field over to another Jira field using automation. So I don't think it's form name kind of thing. But I will give it a try!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you output the smartvalue to the log how does it show? Cause that might also give us a clue on how to validate it.
Depending on the type of field it could be "empty" but that doesn't mean it's actually empty in the database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tested with forms.last.keyvalue comparing with "Condition equals Empty" and it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to shirt it to a different field and base it on an actual value, which worked. I tried all kinds of combinations with the blank/empty value and nothing ever worked for me. But I am able to get it to run now. Thanks for the help!
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.