You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi everyone,
I want to get a String without whitespaces using smart values (in Project Automation), which copies values of a Multi-user picker field into a single-line text field.
By simply using {{issue.myField}}, It puts white spaces between usernames:
usernameA, usernameB, usernameC
I've tried :
{{issue.myField.remove("")}}
and
{{issue.myField.deleteWhitespace()}}
but all characters were deleted!
Do you know how I can remove those spaces?
Thanks.
Hi everybody,
Thanks by this solution, this helped me a lot.
But, I can use it .replace(" ", "")}} more than once?
For example:
{{Name.replace(" ", "") ("á", "a") ("é", "e")}} etc
In my work use the name of employe for create the email and need replace the characters with accents and umlaut or specials (ñ, ç).
ok, the correct syntax is reiterate the function for each case:
{{Name.replace(" ", "").replace("á", "a").replace("é", "e")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Couldn't get it to work. I have a field `issue.Domain` but when I create a variable (Smart Value) called DomainLabel with {{issue.Domain.replace(" ", "")}} it just returns an empty string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Is possible that atlassian not recognize the name of your field, trial use with this sintax:
{{issue.customfield_XXX.replace(" ", "")}}
Wherein XXX is the ID of the field. This ID you can see in the URL of setting of the field, in the image is the las number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aaron,
doesn't work either. For full context, the custom field is a list of which only one option can be selected (only text values). What I'm trying to do is use a web request automation rule that labels a linked Confluence page with the "Domain" value of the issue. Domain values can have spaces however, so I want to replace the spaces with "-" so Confluence doesn't create a label per word in the selected Domain value.
API: https://<tenant>.atlassian.net/wiki/rest/api/content/{{createdPage.id}}/label
Method: POST
Body:
[
{
"prefix": "global",
"name": "project-overview"
},
{
"prefix": "global",
"name": "{{issue.Domain.replace(" ", "-")}}"
}
]
I thought the double quotes inside the replace function are causing issues with escaping, but when I copy the code to a Create Variable automation component the behaviour is the same. It just returns "".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David
If you use a select field, you need add ".value" in the syntax for indicate that use this, in your case:
{{issue.Domain.value.replace(" ", "-")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've not tested this but I am pretty sure all you need to do is
{{issue.myField.trim()}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not sure you still need it but I was facing the same issue and I found a workaround.
Use the Create Variable component to create the smart value without the space (using remove or Replace function)
For some reason, the Edit issue field component did not work for me each time I tried to type the character space. But editing inside the create Variable component worked perfectly.
You can then use those smart variables inside the Edit Issue Field component.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.