Step to reproduce.
1. Create a simple text custom field (my case is `Account holder's name`.
2. Add the custom field to a new Request type.
3. Create a Jira Automation triggered by this Request type.
4. In automation add a step to print the following comment
```
"{{issue.Account holder's name.value}}"
"{{not(issue.Account holder's name.value)}}"
"{{issue.Account holder's name.isEmpty}}"
"{{not(issue.Account holder's name.isEmpty)}}"
"{{issue.Account holder's name.value.isEmpty}}"
"{{issue.Account holder's name}}"
```
5. Raise a request ticket using the Request type created, don't fill in anything in your custom field.
6. Now you will get a comment
```
""
"true"
""
"true"
""
""
```
`IsEmpty` either returns null or true. It always returns' true' if I test it with `not(isEmpty)`. It is not correct. Am I doing sth wrong? I also tried `isNotEmpty`, but the result was the same, always `true` after `not`.
Hello @Michael Tai
If Text 1 is your text field, then {{Text 1.isEmpty}} will give true/false based on if field has value.
Can you tell if {{issue.Account holder's name}} is returning value of the field? If it is not:
You need to be able to log the value successfully so you can evaluate if its empty or not.
Hope it helps and let me know if issues / concerns. Thanks!
Hi Kalyan,
I tried, in the comment I print `"{{issue.Account holder's name}}"`, it is `""`. It makes sense because I didn't fill in anything in this field.
I have another field in this request type which I did fill in sth, and it is printing correctly.
It is already a refetch step after the trigger.
I just tested `"{{issue.customfield_11875.isEmpty}}"`, but still it returns me `""`
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Michael Tai
isEmpty should have worked.. but if it does not.. Please try to log below value:
Below smart value explicitly checks if field is empty, if so, will return true..
{{#if(not(exists(customfield_11875)))}}true{{/}}
you can then use it in your conditional statements.
Hope it helps. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! `exists` works! Though `isEmpty` is still not working, at least I have a workaround now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Michael Tai
I checked and yes, for some fields isEmpty is not working and you need to use the if/exists condition to evaluate.
Please let us know issues and accept answer if it solves your issue so others can benefit. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Michael Tai
Yes, and...to Kalyan's suggestions:
I recall there can be differences in rules for some fields which were never set (i.e., null) versus set to a value and later cleared (i.e., now an empty string). Worse still, the behavior may be different for the same field when the issue is an element in a list versus a single issue. The only way to confirm is experimentation.
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.
"Exists" also worked for me! Thanks @Kalyan Sattaluri !
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.