Forums

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

Jira smart values splits but can't select the element I want.

Mike Rathwell
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.
August 6, 2021

I am using the JMWE Cloud email issue function and having difficulty getting a text split to give me the element I want to make a friendly greeting.  From a user picker custom field, I want to select the human's first name. It seems that the split function on the text field smart values page should work. However:

Hi {{ issue.fields.customfield_10661.displayName.split(" ").first }},

returns "Hi ,"

Hi {{ issue.fields.customfield_10661.displayName.split(" ") }},

returns "Hi firstName, lastName,"

Clearly it is actually splitting it. What I cannot figure out is how to select that firstName and display that rather than... a blank.

1 answer

0 votes
Mike Rathwell
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.
August 6, 2021

Found it myself... I was Doing It Wrong. Turns out THIS works

Hi {{ issue.fields.customfield_10661.displayName.split(" ") | first }},
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.
August 6, 2021

Hi @Mike Rathwell 

I wonder how that pipe character is working with a list.  I would think this would work:

{{issue.customfield_10661.displayName.split(" ").first}}

Best regards,
Bill

Mike Rathwell
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.
August 6, 2021

I have NO idea @Bill Sheboy 

I tried it that way the first time and it returned... nothing. As soon as I put the pipe in... it worked. Moving from Server to Cloud, every day I find a new faceplant event.

Like Bill Sheboy likes this
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.
August 6, 2021

Gotcha, and FYI the pipe is normally the default operator for cloud automation smart values; so if the left side is invalid it uses the right side value.

I also run into "undocumented behaviors" when using automation rules, so no surprise this one works differently too.

__Bill

Suggest an answer

Log in or Sign up to answer