Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing the custom text field for phone numbers

Megan Hannon October 4, 2021

Hello, 

I currently collect phone numbers in various forms using a custom text field which displays the number as 1234567890.  Is there a way to customize the field so that there are dashes separating the phone number so that it displays as 123-456-7890?

 

1 answer

1 accepted

2 votes
Answer accepted
Radek Dostál
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.
October 4, 2021

Without plugins no.

You'd need a new custom field type able to convert this value to your desired format. Somewhat similar to how Number field works - the value is stored as a number, but the renderer adds commas to it for view, and view only.

 

I'm not familiar with such a plugin though - just to comment you can't do this out of box unless you change the value itself.

Radek Dostál
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.
October 4, 2021

Do you have ScriptRunner by a chance? You'd be able to set up a Scripted Field to take the "real" field's value, and change the format: https://scriptrunner.adaptavist.com/6.20.0/jira/scripted-fields.html

 

Or use the console to modify the values themselves, well, a lot of ways to go I suppose.

Megan Hannon October 4, 2021

Thank you Radek! I do have script runner and will take a look at the scripted fields.

Suggest an answer

Log in or Sign up to answer