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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

806 views 2 19
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