Nested Smart Values

Joel_Hall April 7, 2020

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

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2020

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!

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2020

Well, I finally got a request filed for this:

Possibility to nest smart values in Automation: 

https://codebarrel.atlassian.net/browse/AUT-2086

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2020

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

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2020

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

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2020

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.  ;^)

0 votes
Richard Bouchacourt April 7, 2020

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

Joel_Hall April 7, 2020

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?

Richard Bouchacourt April 7, 2020

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.

Like Joel_Hall likes this
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2020

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events