Gadget Title/lable/Headline???

Hey

Anyone know if (and how) its possible to add a title to a spefic gadget or section of gadgets on a dashboard/wallboard

I have to display a wallboard, with 2 identical gadgets (Column order gadget), and it would be nice to hade a header descriping what is shown below.

12 answers

1 accepted

We use the gadget "Text" above the gadget that needs a title.

The text gadget has to be enabled via System Plugin with the name "Atlassian JIRA - Plugins - Gadgets Plugin"

Instead of using the Text Plugin from Atlassian to add an extra header above the existing plugin titles - I've used it to embed some javascript to correct the title of the existing gadgets. It seems to work and looks great!

Steps to reproduce:

  • Enable the Atlassian Text Plugin (it is not enabled by default, because of security)
  • Add the Text gadget to the dashboard where you wan´t custom titles for our gadgets  
    • Usually I add the gadget to the bottom of the dashboard in a collapsed state (so the users don´t notice it so much)
  • In the Body field type the javascript given below
    • Make sure to edit the "gadget_titles" variable with the ids of your gadgets and wanted custom titles (use firebug etc. to find the gadget id's) 
<script type="text/javascript">


var gadget_titles = [
  { 
    id : "gadget-10200-title",
     title : "My new title 1"
   },
  {
    id : "gadget-10205-title",
    title: "My new title 2"
  }
  // Add gadget ids and titles here 
]
// Go through all the defined titles
gadget_titles.forEach(function(item, index) {
  // Get the title gadget element from the DOM:
  var element = parent.document.getElementById(item.id);
  if (element) {
    // Change the title
    element.textContent = item.title;
  }
})
</script>

 

 

 

Wow, great but looks dangerous as others here are pointing out.  Works great for my use-case.

This works great! But when I refresh the browser page the title reverts back and the script doesn't run until I go back into the Text gadget and hit save. Any way to fix that?

Well I had the same problem. It happens because some JIRA script loads afterwards and overwriting the custom headers (set by my script). I fixed this by adding a delay to the script, but this is not guarantied to work for everybody everywhere (it will only work in IE9 or above).
Maybe I could come up with a more bullet prof solution, but for now it works fine for us.

 

<script type="text/javascript">

var gadget_titles = [
  {
    id : "gadget-10200-title",
     title : "My new title 1"
   },
  {
    id : "gadget-10205-title",
    title: "My new title 2"
  }
  // Add gadget ids and titles here
]
 
// Wait for page DOM is loaded and the set the headers
document.addEventListener("DOMContentLoaded", function(event) { 
  // Extra delay is needed (another jira-script is overwriting the headers)
  window.setTimeout(initMyHeaders, 700);
});
 
function initMyHeaders() {
  // Go through all the defined titles
  gadget_titles.forEach(function(item, index) {
    // Get the title gadget element from the DOM:
    var element = parent.document.getElementById(item.id);
    if (element) {
      // Change the title
      element.textContent = item.title;
    }
  });
}
</script>

Thank you! That worked while using a Chrome browser as well. 

Via JIRA 'Administration', tab 'Plugins', click on 'Show system plugins'.

I this section we have "Atlassian JIRA - Plugins - Gadgets Plugin". (I don't remember explicitly installing this - but that is possible ;-) )

One of the 48 modules that comes with this plugin is "Text (text gadget)" and this module has to be enabled.

(We use JIRA version 4.4.4.)

How to enable the "Text" gadget in Jira 6:

  • Go to Administraion section: Add-ons > Manage add-ons
  • Select 'System' from the drop down Add-on filter menu (it is next to the field 'Filter visible add-ons')
  • Open the section with name "Atlassian JIRA - Plugins - Gadgets Plugin"
  • Enable all 64 modules or scroll down the list until you find the module called "Text" and enable this one.

Where is the Text Gadget to be found? It's not a stock gadget.

Thanks, Alan! This is exactly what I was looking for! I just ask myself why such a helpful Gadget is disabled by default? (Jira 5.2.9)

Yeah... where is this?

Yeah... where is this?

If Text is itself a gadget, then the new title would appear above the default title block in the wallboard so if I create the Text Gadget "My Burndown", then the default "Agile Sprint Burndown Gadget" would still appear. What I am looking for is a way to replace the default text.

It looks like the Text gadget works well for adding a title to a group of gadgets.  However, changing the title of a single gadget appears to be an issue that has been open for quite some time.  It seems like an easy enough thing to fix.  Go vote for it!

https://jira.atlassian.com/browse/JRA-19766

"The text gadget can make JIRA vulnerable to XSS attacks because it allows arbitrary html, which is why it is disabled by default".

Replacement has been requested to Atlassian. No commitment from Atlassian...though
https://jira.atlassian.com/browse/JRA-21965

New feature was released in July, where dashboard gadgets can now be renamed in JIRA. Just hover on the gadget's title bar and select the more (…) button. Then, choose Rename.

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
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

365 views 0 6
Read article

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