How do you nest/combine Smart Values?
I'd like to check to see if the first 9 characters are numeric.
The format of "valid" values from the source of record is 123456789_12 or #########_##
This provides the first 9 characters successfully ->{{issue.field.left(9)}}
AND
This provides the result if it's numeric successfully -> {{issue.field.isNumeric()}}
How to I combine these to see if the first 9 characters are numeric from this entry? 123456789_12
Greetings, community! What was the answer in regards to nesting of smart value expressions? I have not been able to get this to work either.
Thanks!
Well, I finally got a request filed for this:
Possibility to nest smart values in Automation:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Darryl Lee
I previously submitted a related defect, that smart values (issue or variable) do not work within an iterator. For example:
{{#issues}}* {{key}}, elapsed days: {{created.diff(now).days}} {{/}}
I heard back, "not intended to work that way; functions as designed." More generally, the supported automation processing engine for Jira Cloud is not the same as for JSD, so it may help customers to submit two defects, when appropriate. For example, {{issues}} (result set of JQL) is only on supported for JSD at this time, but nested syntax within iterators is not supported in either product.
__Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh yes, "Legacy Automation" (that's what they call it now). I'm new to JSD, so I didn't have any experience with the old automation.
Do they support iterators at all? My minimal exposure to Legacy Automations led me to believe the options were much more limited:
https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Overview-over-variables-fields-I-can-use/qaq-p/677109
https://jira.atlassian.com/browse/JSDCLOUD-5916
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not know if the iterator issue is legacy versus new automation related... The "new" automation in JSD (Automation for Jira) does support iterators, as there is an example in one of the documentation pages showing the use of {{#issues... }} processing after a scheduled JQL trigger.
Regarding the supported smart value (and scoping) documentation, I made a suggestion that automation documentation could be more like what is provided for the REST API, with a single, ginorous page with expandable sections, showing examples, scoping (Jira, JSD, or both), error messages, alias naming for UX, Smart Value, and REST API, etc.
One can hope. ;^)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Joel_Hall
Use the abbreviate() function to select the first nine characters.
and the isAlpha() function to determine if the expression does not contain character. The function should return false in your exemple.
Here is the smart values documentation.
Let me know the solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Separately each function works as advertised.
The format of "valid" values from the source of record is 123456789_12 or #########_##
I'm trying to combine the Smart Values to check to see if what's entered matches the format.
So in english I'm trying to "Test to see if the first 9 characters are numeric"
I can test to see if the 10th character is an undersocre (_) just fine
Thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice thought @Joel_Hall , try to create the most simple rule (check the underscore).
You know better than me all the different values stored in your custom field. Like in science, the most simple and general rule almost works better than complicated ones. I try to keep in my minds this method.
Hope you find the right rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As to the original post, would this work?
{{issue.field.left(9).isNumeric()}}
In my experience I've been able to "combine" methods (I'm sure that's not the right terminology) this way.
Example: {{issue.field.value.toLowercase().replace(" ","_").urlEncode}}
That takes the field, converts it to lowercase, replaces spaces with underscores, and finally, urlEncodes it.
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.