Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Use SmartValues/String-Operation

Olli June 2, 2022

Displayname is: Mustermann, Max AB

Used smart-Values in automatation:

a: {{initiator.displayName}}
b: {{initiator.displayName.left(10)}}
c: {{initiator.displayName.lastIndexOf(" ")}}
d: {{initiator.displayName.left(15)}}

Result without error:

a: Mustermann, Max AB
b: Mustermann
c: 15
d: Mustermann, Max

I like to have the result from d) for EVERY Displayname. So I want use c) and d) together:

{{initiator.displayName.left({{initiator.displayName.lastIndexOf(" ")}})}} 

(I want put the result from c) as a number in d).

But there comes an error. Whats wrong?

 

1 answer

1 accepted

4 votes
Answer accepted
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.
June 3, 2022

Of the top of my head I think you can combine these operators thusly:

{{initiator.displayName.left(initiator.displayName.lastIndexOf(" "))}}

But I need to test it.

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.
June 3, 2022

Ok, confirmed that this worked. Good luck!

Like # people like this
Olli June 3, 2022

OK. Without the {{ }}

 

THANK YOU!

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.
June 3, 2022

Hi  @Olli 

Yes, and...to Darryl's answer:

If you always have the same suffix, such as "AB", you could use the function substringBeforeLast()

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringBeforeLast-String-separator-

Kind regards,
Bill

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events