Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Load Scriptrunner Web-Panel after Issue Page


I have a web panel that I have created that roles data up from issues 'below it' using various JQL queries. This obviously takes some time as there are a lot of issues and data to be rolled up and then displayed. From the difference in loading time of the tickets, it is clear that it would be nice to be able to load the main issue first and then my panel, much like some of the other panels we have that are made by main venders. 

Is there any way I can achieve this in script runner using web panels or am I going to have to write a plugin? 

Thanks in advance.

2 answers

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 25, 2020

I've never had your specific scenario or tried what I'm about to suggest, but I think maybe you could do it this way:

  • Move most of your code in a rest endpoint.
  • Then your web panel would just include some simple javascript to call the rest api using ajax then load a placeholder div with the html returned from the rest api.

This way the issue will load immediately and the panel will load when the rest api is done. You could show some temporary text or a spinner in the panel while waiting for the ajax call to complete.

Thanks for the speedy reply,

That does make more sense than what I was trying to do. Am I approaching rolling up data in the correct way by using a JQL statement or is there a better way that would be suggested for getting ‘child issues’ as at current I didn’t see a way to traverse portfolio child issues in the API.

Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 25, 2020 • edited

Sorry, I haven't used Portfolio yet. So I don't know if there is a native object model that can be used to find issues using that relationship. If it was just linked issue or issue/child issues like subtasks, then I would recommend using the issueLinkManager and the subTaskManager. But I don't know the Portfolio equivalent.

No worries, have already been round the loop of issue/child issue not being the same for subtasks and portfolio but that is a different discussion. Thanks for the suggestions.

Hey Matt did you implement this ? Does it work ?

I geht this done.

In Groovy Web Panel your Code have to look like this.


import com.atlassian.jira.issue.Issue

Issue issue = context.issue as Issue

// Erstellen des HTML-Tags
def html = """
    <button id="myButton">Klick mich</button>
    <div id="result">Hier erscheint das Ergebnis</div>
        function textAendern() {
            document.getElementById("result").innerHTML = "Lade...";

            // Führen Sie eine asynchrone Anforderung an den Server durch, um Daten zu erhalten
            var xhr = new XMLHttpRequest();
  "GET", "PASTEYOURLINKHERE" + '${issue}', true); // Ersetzen Sie dies durch den tatsächlichen API-Endpunkt
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4 && xhr.status === 200) {
                    var data = xhr.responseText;
                    document.getElementById("result").innerHTML = data;
                } else if (xhr.readyState === 4) {
                    document.getElementById("result").innerHTML = "Fehler beim Abrufen der Daten.";

        document.getElementById("myButton").addEventListener("click", textAendern);

The link refers to jira rest endpoint where you have to provide your data.
For example as string with html design. Then you need the last line of code to return the value.
resultString = """
<table style="width: 100%; text-align: left;">
            <th>COLUMN ID</th>

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events