How to transform a custom text field in a URL it is displayed by Jira?

I have a custom field that contains that ID or an issue from another system but I want it to displayed as an URL instead as an simple text field.

How can I do this in Jira?

Remark: the field itself is not a full URL, it is just an ID and I want to add the rest of the url.

Update: I think this may be related to https://confluence.atlassian.com/display/JIRA/Configuring+Renderers but I am not sure how I can implement this.

I do have Jira 4.4 and the specified Renderers link does not appear at all in the interface!

1 answer

1 accepted

Create a plugin and add this inside <atlassian-plugin>...</atlassian-plugin>

&lt;customfield-type key="textfield" name="Scale Id"
                      class="com.atlassian.jira.issue.customfields.impl.RenderableTextCFType"&gt;
        &lt;description&gt;Scale Id&lt;/description&gt;
        &lt;resource type="velocity" name="view" location="templates/view-scaleid.vm"/&gt;
        &lt;!--&lt;resource type="velocity" name="view" location="templates/plugins/fields/view/view-basictext.vm"/&gt;--&gt;
        &lt;resource type="velocity" name="edit" location="templates/plugins/fields/edit/edit-maxlengthtext.vm"/&gt;
        &lt;resource type="velocity" name="xml" location="templates/plugins/fields/xml/xml-basictext.vm"/&gt;
    &lt;/customfield-type&gt;

This is the {{view-scaleid.vm}} template:

#if ($value)
 &lt;a href="http://example.com/browse/$!value.toString()"&gt;
 #if (${displayParameters.excel_view})
     $textutils.br($textutils.htmlEncode($!value.toString(), false))
   #else
     $!value.toString()
   #end
 &lt;/a&gt;
 #end

Still, if you already have the field added, you will have to change its type inside the database, table is named customfields.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,338 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot