if customfield_12038 = "constituents" and customfield_12808 is empty
print("Data requirement is constituents, you must enter a data type")
Conditional Logic | Output when true | Output when false | Notes |
---|---|---|---|
(6) Checking field: Data Requirement | Data requirement is empty. Please add a value. |
| |
(6) Checking field: Data Requirement {{#if(not(equals(customfield_12038, isEmpty)))}} |
| Data requirement is not empty. Value = Constituents No action is required on this field. If data requirement = "constituents", please ensure data type has a value. | |
(7) Checking field: Data Type | Data type is empty. Please add a value if data requirement = "constituents". |
| |
(7) Checking field: Data Type {{#if(not(equals(customfield_12808, isEmpty)))}} |
| Data type is not empty. Value = Open. No action is required. | |
TEST A - CONS {{#if(not(customfield_12038.value("Constituents")))}} Data requirement is not Constituents. No action is required. {{/}} | TEST A - CONS | TEST A - CONS | Same output when customfield_12038 = Constituents and when customfield_12038 != Constituents |
TEST A - PARTNER {{#if(not(customfield_12589.value("DP-TEST")))}} Data partner is not DP-TEST. No action is required. {{/}} | TEST A - PARTNER | TEST A - PARTNER | customfield_12589 = DP-TEST, but automation says it isn’t Same output when customfield_12589 = DP-TEST and when customfield_12589 != DP-TEST |
TEST B - PARTNER EMPTY {{#if(equals(issue.customfield_12589, "None"))}} Data partner is empty. Please add the data partner{{/}} | TEST B - PARTNER EMPTY | TEST B - PARTNER EMPTY | customfield_12589 = DP-TEST, but automation says it isn’t Same output when customfield_12589 = DP-TEST and when customfield_12589 != DP-TEST |
TEST B - PARTNER NOT EMPTY {{#if(equals(issue.customfield_12589, "DP-TEST"))}} Data partner is not empty. Value = "{{customfield_12589.value}}"{{/}} | TEST B - PARTNER NOT EMPTY | TEST B - PARTNER NOT EMPTY | Same output when customfield_12589 = DP-TEST and when customfield_12589 != DP-TEST |
TEST C – CONS STRING {{#if(customfield_12038("Constituents"))}} Data requirement is constituents. {{/}} | TEST C – CONS STRING | TEST C – CONS STRING | Same output when customfield_12038 = Constituents and when customfield_12038 != Constituents |
TEST C – PART STRING {{#if(customfield_12589 ("DP-TEST"))}} Data partner is DP-AAM. {{/}} | TEST C – PART STRING | TEST C – PART STRING | customfield_12589 = DP-TEST, but automation says it isn’t Same output when customfield_12589 = DP-TEST and when customfield_12589 != DP-TEST |
TEST D – PARTNER VALUE STRING {{#if(customfield_12589.value("DP-TEST"))}} Data partner is DP-AAM. {{/}} | TEST D – PARTNER VALUE STRING | TEST D – PARTNER VALUE STRING | customfield_12589 = DP-TEST, but automation says it isn’t Same output when customfield_12589 = DP-TEST and when customfield_12589 != DP-TEST |
TEST D – CONS VALUE STRING {{#if(customfield_12038.value("Constituents"))}} Data requirement is constituents.{{/}} | TEST D – CONS VALUE STRING | TEST D – CONS VALUE STRING | Same output when customfield_12038 = Constituents and when customfield_12038 != Constituents |
Thanks for the details in your question, and well done on methodically working through the cases! Problems in automation rules are often about context, so please consider also posting images of the complete rule and audit log details showing the rule execution.
Without seeing those...
isEmpty() is a function, and not a value; the documentation says it returns true or false and cannot be compared to as you are doing: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#isEmpty--
To test for null or "no value" you could use {{#if(customfield_12038.value)}}has no value{{/}}
To test for "empty string" you could use {{#if(customfield_12038.value.isEmpty())}}has no value{{/}}
However I have observed that not consistently working, so try it to compare to your results. Some Jira fields, even when never set, contain either null (no value) or empty string. Those are not the same thing when testing conditions. Worse still, once some fields are set and later cleared, they do not return to the original null value. Again, please test to confirm.
To test for a specific value, please try the equals() function in your condition:
{{#if(equals(customfield_12038.value, "Constituents"))}} Data requirement is constituents.{{/}}
Kind regards,
Bill
Hi Bill,
Thank you for your contribution - it's much appreciated!
Regarding testing for a specific value, I tried:
When: Manually triggered
If: matches
Data Requirement contains: Constituents
Then: Send email
To - Initiator
Subject - Action required on {{issue.key}}
Content -
{{#if(equals(customfield_12038.value,"Constituents"))}}
Data requirement is constituents.{{/}}
As expected, when I ran the automation an email was send because data requirement = constituents. However, the email had no content. I was expecting the email to contain the message "Data requirement is constituents".
(I tried adding a screenshot of the automation rules, but I wasn't able to due to the error "Permission Denied".)
Best regards,
Emily
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is an curious message for trying to add the image. Did you see that using the Insert Photos option for your post?
What is the type of your "Data Requirement" field: single-select option, multiple-select option, or something else?
For the options in the custom field configuration, have you confirmed:
Either one of those could also cause a mismatch.
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.