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

Copying number field using automation truncates the values.

Kautilya Fadia IN August 20, 2021

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

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

then URL becomes: 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 

2 answers

1 vote
Ignacio Pulgar
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.
August 20, 2021

Hi @Kautilya Fadia IN ,

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

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

More info in the docs.

Hope it helps.

Regards

Kautilya Fadia IN August 23, 2021

hi @Ignacio Pulgar 

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

Attached snapshot of how I've configured it. 

Like Stefan Peev likes this
Ignacio Pulgar
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.
August 23, 2021

Hi @Kautilya Fadia IN ,

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

Kautilya Fadia IN August 23, 2021

Hi @Ignacio Pulgar 

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. 

Ignacio Pulgar
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.
August 23, 2021

Hi @Kautilya Fadia IN ,

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

Kautilya Fadia IN August 23, 2021

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.

Like Ignacio Pulgar likes this
0 votes
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 22, 2021

Hi @Kautilya Fadia IN ,

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

Cheers,

Simeon.

Kautilya Fadia IN August 23, 2021

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

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2021

@Kautilya Fadia IN , try changing the ### to a single #

That seemed to work for me

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events