Change Jira custom field inner HTML using javascript

Tova Pozen February 7, 2018

I need to change the name of 4 locked Jira custom fields:

Epic Link

Epic Name 

Epic Color

Epic Status

 

I can do that by unlocking the fields through the DB and changing their names. But as per Atlassian it's not recommended.

So, instead, I want to insert a short javacript code that will change only the text on the UI.

 

At first. I inserted into the Announcement Banner the following code:

<script type="text/javascript">
AJS.$(document).ready(function () {document.querySelector('[title="Epic Link"]').innerHTML = "Feature Link"})

</script>

 

It worked, but also caused some issues in loading other parts of the GUI.

can we insert the code in another location where it will run only on the specified field?

Or maybe the code is problematic?

 

 

1 answer

1 accepted

0 votes
Answer accepted
Brittany Wispell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2018

I'd say look into some of the scripting add-ons. I know ScriptRunner has Behaviours that might be able to achieve this. 

ScriptRunner

or here are some others...

Power Scripts for Jira Script Automation

Tova Pozen March 11, 2018

Thanks

I finally used JSIncluder add-on.

Suggest an answer

Log in or Sign up to answer