JIRA Help icon - custom fields

Hi,
We would like to have help icon for some custom fields. When I define the below code for 2 custom fields, I am seeing help icons for the 2 custom fields but when I click on help icons, it always opens the first value (3 - High, 2 - Medium, 1 - Low)  which is in code 1 as below. I would like to see (3 - High, 2 - Medium, 1 - Low) when I click on help icon code 1 custom field and (3 - Sev1, 2 - Sev2, 1 - Sev3) when i click on help icon code 2 custom field.

 

Code 1:
<script type="text/javascript">
function showHelp() {
var helpDiv = AJS.$("#ProbabilityFieldHelp");
if (helpDiv.length == 1) {
helpDiv = helpDiv[0];
if (helpDiv.style.display == 'none')

{ helpDiv.style.display = ''; } else { helpDiv.style.display='none'; }
}
}
</script>

<a href="#" title="Click '?' for help" onclick="showHelp(); return false;"><img src="/images/icons/ico_help.png"/></a>

<div id="ProbabilityFieldHelp" style="display:none">
3 - High</br>
2 - Medium</br>
1 - Low</br>
</div>

Code 2:
<script type="text/javascript">
function showHelp() {
var helpDiv = AJS.$("#ImpactFieldHelp");
if (helpDiv.length == 1) {
helpDiv = helpDiv[0];
if (helpDiv.style.display == 'none') { helpDiv.style.display = ''; }

else

{ helpDiv.style.display='none'; }

}
}
</script>

<a href="#" title="Click '?' for help" onclick="showHelp(); return false;"><img src="/images/icons/ico_help.png"/></a>

<div id="ImpactFieldHelp" style="display:none">
3 - Sev1</br>
2 - Sev2</br>
1 - Sev3</br>
</div>

3 answers

1 accepted

Hello Karthick,

booth java script snippets using the same function, i think that is the problem. They must be unique.

Here is my example, we have two custom fields where we see contact details from an external vendor.

Contact details
&lt;script type="text/javascript"&gt;
  function showHelpCompany1() {
        var listenersDiv = document.getElementById("qaFieldHelpCompany1");
        if (listenersDiv.style.display == 'none') {
          listenersDiv.style.display = '';
        } else {
          listenersDiv.style.display='none';
        }
  }
&lt;/script&gt;
&lt;a href="#"  onclick="showHelpCompany1(); return false;"&gt;&lt;img src="/images/icons/ico_help.png"/&gt;&lt;/a&gt;
&lt;div id="qaFieldHelpCompany1" style="display:none"&gt;
Phone: +49 12 34 56 78 &lt;br&gt;
&lt;/div&gt;
Contact details
&lt;script type="text/javascript"&gt;
  function showHelpCompany2() {
        var listenersDiv = document.getElementById("qaFieldHelpCompany2");
        if (listenersDiv.style.display == 'none') {
          listenersDiv.style.display = '';
        } else {
          listenersDiv.style.display='none';
        }
  }
&lt;/script&gt;
&lt;a href="#"  onclick="showHelpCompany2(); return false;"&gt;&lt;img src="/images/icons/ico_help.png"/&gt;&lt;/a&gt;
&lt;div id="qaFieldHelpCompany2" style="display:none"&gt;
Phone: +49 12 34 56 78 &lt;br&gt;
&lt;/div&gt;

I think you see what i mean.

 

Regards,
Tim

Thank you so much. It works.

Hello Karthick, it seems that the html in the description field won't be interpreted in "User Picker (single user)". If I place a link there (like <a href="http://xxxxxxxx.com/x/ygA3" target="_blank">HG Field Description</a>) the system displays me the whole syntax.

Can you confirm this, is it a bug?

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 ...

2,991 views 12 18
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