The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Darryl Lee
Community Champion
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 Champion
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 Champions.
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
TAGS
AUG Leaders

Atlassian Community Events