Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Smart Value Strings

Peter Jeffery
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 18, 2022

Within a automation I am doing an Advanced compare condition that is:

{{fieldChange.toString.left(fieldChange.fromString.indexOf(":"))}}

This gets me the start of the string up to the character before the ":".  However, I want to include ":", so have tried is:

{{fieldChange.toString.left(fieldChange.fromString.indexOf(":")+1)}}

But this gives and error.  How do I add 1 to the indexOf?

2 answers

1 accepted

0 votes
Answer accepted
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.
March 18, 2022

Hi @Peter Jeffery 

You cannot add numbers like that in a smart value expression without using the mathematical expression syntax: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

Instead, please try using the plus() function, such as:

{{fieldChange.toString.left(fieldChange.fromString.indexOf(":").plus(1))}}

Kind regards,
Bill

0 votes
Florian PEREZ [Valiantys Administrator]
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.
March 18, 2022

Not sure but you can maybe try the following, it seems more logical to me (not sure it will work and not even sure it's possible). 

 

{{fieldChange.toString.left(fieldChange.fromString.indexOf(":"+1))}}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events