Copying number field using automation truncates the values.
Asked by Kautilya Fadia IN:

I have use case where user enters a number field in Customfield A, and need to generate URL in second field e.g.: [www.example.com/cusomfield.A](http://www.example.com/cusomfield.A)

the issue is, if value in A is larger. e.g: 99898099

then URL becomes: [www.example.com/9.9898099E7](http://www.example.com/9.9898099E7)

so my requirement is

1. I need to remove decimal from the number field
2. Need to get exactly same value as in Field A. no truncation etc.

it would be great if any one can help me with this.

Thanks


Answers:
author: Ignacio Pulgar
body: Hi [@Kautilya Fadia IN](/t5/user/viewprofilepage/user-id/3177851) ,

You may change the number format in the smart value like this:

    {{issue.Customfield A.format("###")}}

More info in the [docs](https://support.atlassian.com/jira-software-cloud/docs/smart-values-math-expressions/#Smartvaluesmathexpressions-Formatnumericalvalues).

Hope it helps.

Regards

comments: author: Kautilya Fadia IN
body: hi [@Ignacio Pulgar](/t5/user/viewprofilepage/user-id/781574)

I tried .format in automation but for some reason its not working. everytime I use .format it seems to ignore value in number field

![2021-08-23 12_26_40-Clipboard.png](https://community.atlassian.com/t5/image/serverpage/image-id/157080iE38E6E3F792BAAA5/image-size/large?v=v2&px=999 "2021-08-23 12_26_40-Clipboard.png")

Attached snapshot of how I've configured it.


author: Ignacio Pulgar
body: Hi [@Kautilya Fadia IN](/t5/user/viewprofilepage/user-id/3177851) ,

When and how exactly does that format fail?

If format doesn't have a consistent behaviour, then I'd consider using a custom field of type Text (single line) instead of Number type.

Regards


author: Kautilya Fadia IN
body: Hi [@Ignacio Pulgar](/t5/user/viewprofilepage/user-id/781574)

the issue is, if value in A is larger. e.g: 99898099

instead of getting example.com/99898099

it puts example.com/

completely ignores customfield. although automation rule passes so no failure log.


author: Ignacio Pulgar
body: Hi [@Kautilya Fadia IN](/t5/user/viewprofilepage/user-id/3177851) ,

The format has worked for me in tests with higher numbers.

Maybe you can use a Text field (single line) to avoid number format issues.

Regards


author: Kautilya Fadia IN
body: yeah using text field was last option. This is pure numbers field. not sure why Jira behaves erratically with numbers.   

thanks for the help will try to use Text field.


author: Simmo
body: Hi [@Kautilya Fadia IN](/t5/user/viewprofilepage/user-id/3177851) ,

If you could attach some screenshots of how you're generating the URL in the automation rule that would really help.

Cheers,

Simeon.

comments: author: Kautilya Fadia IN
body: ![2021-08-23 12_26_40-Clipboard.png](https://community.atlassian.com/t5/image/serverpage/image-id/157077iD71E6C406526B151/image-size/large?v=v2&px=999 "2021-08-23 12_26_40-Clipboard.png")  

I've customfield_11305 as Number field, which by default takes floating numbers.

part with <http://example.com> is static, I just need to place customfield_11305 after URL like: if customfield_11305 = 11223322 URL should be: <http://example.com/11223322>


author: Simmo
body: [@Kautilya Fadia IN](/t5/user/viewprofilepage/user-id/3177851) , try changing the ### to a single #

That seemed to work for me


Tags: cloud