Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Number to string automation

Petr A May 17, 2024

Dear Community!

I'm trying to convert a number to a string, but my attempts have not yet been successful.

TN.png

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()}}

 N.png

Thanks in advance!

2 answers

1 vote
Vijay Dadi
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.
May 17, 2024

try - AsString(customfield).

hope it works

 

Petr A May 22, 2024

Hi @Vijay Dadi 

Thanks for your answer

Unfortunately it didn't work, can't get value via AsString(customfield), tried various options((

0 votes
Tugba Capaci
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.
May 17, 2024

Hi @Petr A,

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:

Screenshot 2024-05-17 at 16.03.19.png

- And then, in the rule, I tried to add this field as a comment using the following rule:

rule.png

- As a result, it correctly added the number field to the issue's comment like:


Screenshot 2024-05-17 at 16.02.56.png

I hope this helps.

Tugba
actioner.com 

Petr A May 22, 2024

Hi @Tugba Capaci 

Unfortunately it didn't help, the phone number is indicated without a dot and looks like a large number

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events