Hi Jira community,
I have read through the documentation here Jira smart values - text fields | Cloud automation Cloud | Atlassian Support on the different string manipulation methods available to format Jira Smart Values.
I need to capitalize each word in a field but I note that the "capitalize()" method only capitalises the first word in a field.
Use case example:
A text field contains the value "john smith". I need a method to transform the field value to "John Smith".
Do you know if such a method exists on Jira? I can't seem to find anything in the documentation.
Thank you,
Best regards
Jakob
You can combine multiple functions just like how we use them in Javascript. So in this case, you want to do the following:
1. Get the value of the custom field e.g. fullname
2. Split the text value bye .g. a space
3. Capitalize the first letter for each word
4. Join each word separated by e.g. a space
Try to use the following smart value:
{{issue.fullname.split(" ").capitalize().join(" ")}}
I hope it helps.
Best Regards,
Marini
Hi Marini,
Your suggestion worked. Thank you very much.
Best regards
Jakob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.