Forums

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

Custom field text to clickable URL.

Deleted user July 31, 2023

Hi

I have a requirement as following

The user will enter a number in the custom field which is validated to enter number only while creating a ticket. Once ticket gets created I need that number to get added to the URL so that user clicks that link and it takes to the appropriate page. 

Eg: In a different enterprise system, there is a numeric id for a ticket, and that numeric id is entered in Jira, I need JIRA custom field which enables users to input that number and that field data should convert into URL like http://abcdef.com/nbvj/1234 in ticket view  so that user gets direct to that page when clicked.

Am new to JIRA scripting and am not sure where to add the script and what to code. I'm a beginner so any help is appreciated

 

This is in JIRA-Cloud

1 answer

1 accepted

1 vote
Answer accepted
Els Bassant
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.
July 31, 2023

Hi @[deleted] , 

This can be solved with the inbuilt automation functions.

First you will need to create a custom field with the type "short text" and add that to the create and view screens for your issue type. Then you can use Automation to add the link part using smart values.

Create an automation with the following functions:

Screenshot 2023-07-31 at 11.34.43.png

 

In my example I've named the field for the ticket key "External ticket key" and used your example link http://abcdef.com/nbvj/. Automation combines the two into the resulting link.

Please be aware of the following:

  1. this only works if the base url is always the same
  2. this automation will turn anything added into the original field into a link. So if the number entered when creating the issue is wrong, the link obviously won't work.

If you only need this to happen for specific issue types (or if this is in Jira Service Management, for specific request types) you can add that to the automation as conditions before the action.

Deleted user July 31, 2023

Thank you so much. It worked :)

Like # people like this
Niels Kristian Jensen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 1, 2025

We use the "Data Center" version of JIRA and the above does not seem to work:

The custom field type does not exist - the closest is "Text field (Single line)"

The custom field does not show on the selectable drop down list when entering the action (after the "Then:" part of the rule).

Is this function unique to the Cloud version?

Els Bassant
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.
April 9, 2025

Hi Niels, 

"Text field (Single line)" should work for this purpose. In our DC environment I can select all fields of this type in the "Choose fields to set" dropdown when using the Edit Issue action.

If you have just created the field, try refreshing the page. If that fails, a (background) re-index may help. 

Hope that helps, 

Els

Niels Kristian Jensen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2025

I should have added the info, sorry. I did try a - full - reindex without any improvement. 

Perhaps it would be better to modify the Groovy code handling the creation of the issue. We have an integration with ServiceNow which mirrors some issues into JIRA issues.

Els Bassant
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.
April 14, 2025

Hi Niels, 

If the mirroring is already handled in ServiceNow it does seem easier to have the groovy code include the link, if that information is available. 

In the example from the OP is seemed like the external issue ID was entered manually. But if you have an integration already it is less error prone to have the integration include all of the required information when the ticket is mirrored.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events