Get help icon display next to a custom field in jira

Swarna Radha
Contributor
April 3, 2018

Hi , 

I want the help icon next to custom field. When i added the javascript in the description, the help icon appears under the custom field.

Here is the code:

<script type="text/javascript">
function showHelp() {
var listenersDiv = document.getElementById("impact");
if (listenersDiv.style.display == 'none') {
listenersDiv.style.display = '';
} else {
listenersDiv.style.display='none';
}
}
</script>
<a href="#" onclick="showHelp(); return false;"><img src="/images/icons/ico_help.png"/></a>
<div id="impact" style="display:none">
Impact and Urgency ******
</div>

 

Thanks

Swarna

1 answer

0 votes
Teja
Contributor
August 9, 2018

Hi Swarna,

try this below JavaScript

 <script type="text/javascript">
var p = jQuery("#customfield_14202"); //Custom_field ID

function fnOnClickHandler(popUp,page){
popUp.hide();
}
function getpopUp(){
var popUp= new AJS.Dialog({
width:700,
height:425,
id:"mypop",
closeOnOutsideClick:true
});

popUp.addPage();
popUp.addHeader("Definitions", "title-class"); // Header
popUp.addPanel("Panel", "<p>Text here</p>", 'panel-body'); //Body
popUp.addLink("Quit", fnOnClickHandler, "link-class-name", "");
return popUp;
}
function getHelp(popUp){
popUp.show();
}
if(p){
var img = document.createElement("img");
jQuery(img).attr("src","/images/icons/ico_help.png");
var a = document.createElement('a');
var popUp=getpopUp();
a.href='javascript&colon;getHelp(popUp);';
jQuery(a).append(img);
jQuery(p).after(a);
}
</script>

Note: Add this code in field configuration. 

Vineela Durbha
Contributor
February 27, 2024

Hi @Teja 

I tried with above script and it doesnt seem to be working  

Any help on this

Suggest an answer

Log in or Sign up to answer