Dear Community!
I'm trying to convert a number to a string, but my attempts have not yet been successful.
There is an number field, but when you try to send an email or comment with this value, it is converted to a mathematical format - 1.23123123123E11
Is it possible to somehow convert the field to a string?
I tried the following options, but none of them worked.
Number: {{issue.fields.customfield_10000.toNumber().toString()}}
Number2: {{issue.fields.customfield_10000}}
Number3 {{issue.fields.customfield_10000.toString()}}
Number4: {{issue.fields.customfield_10000.tostring}}
Number5: {{issue.fields.customfield_10000.asString}}
Number6: {{issue.fields.customfield_10000.asString()}}
Thanks in advance!
Hi @Petr AST,
You can check out the smart values doc for custom fields here.
Try to use the name of your custom field instead of customfield_10000.
The format should be : {{issue.Custom field name}}
- To test your scenario, I created a number field:
- And then, in the rule, I tried to add this field as a comment using the following rule:
- As a result, it correctly added the number field to the issue's comment like:
I hope this helps.
Tugba
actioner.com
Unfortunately it didn't help, the phone number is indicated without a dot and looks like a large number
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try - AsString(customfield).
hope it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vijay Dadi
Thanks for your answer
Unfortunately it didn't work, can't get value via AsString(customfield), tried various options((
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx to @Tugba Capaci
on the trigger "field change" it was possible to convert the number field value to a String expression, using your provided Link:
{{fieldChange.toString}}
which i was then able to modify using common methods, in my case, extract the first digit:
{{fieldChange.toString.substring(0,1)}}
maybe this helps someone also ;-)
cheers, folks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Petr AST
wondering if you ever found a solution to your problem?
I'm facing the same issue, trying to convert a number field into a string and use the string (to find the 1st and 2nd digit in the number).
I've also tried the options you mentioned above and do not get a string, but am able to retrieve the number from the customfield itself and also i'm able to get the digits, if using a text field.
Though, as you, i do need to do the convert from Number to String!
I've (also) tried:
What did you do in the end to solve your issue? Creating a Text Field works for me, but is not an option, because the Number Field is already in productive use...
Cheers, Dennis.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Did you find any solution?. I've tried all functions you mentioned but also without success.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used regex match() and wrote it into a variable. Since I have used asNumber.max I had to use another variable to read the previous one (number now by reading a string) and I could interact with it like this:
{{tempVar.right(3)}}
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.