Custom field text to clickable URL.

9103296
Contributor
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

0 votes
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 @9103296 , 

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.

9103296
Contributor
July 31, 2023

Thank you so much. It worked :)

Like # people like this

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