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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,702
Community Members
 
Community Events
176
Community Groups

Scriptrunner fragment to display dialog stopped working on Admin pages

I have a Scriptrunner Fragment/Rest API combo that I have been using to put a button on the Admin->System page. When the button is clicked, it displays the dialog generated by the Scriptrunner REST endpoint. This has all been working fine for quite awhile. 

After a recent Jira upgrade (I guess), when I click the button, the dialog doesn't open modally, it opens as a full page. There are no CSS libraries, or jquery, or anything loaded in this new page so nothing works.

If I move this button to an issue page - putting it in the jira.issue.tools location, it works (opens modally) fine.

It seems like the fragment isn't working on Admin pages. Is anyone else seeing this? Has something changed that I missed notification of?

1 answer

Hi @Tom Hudgins

Can you confirm if you are using a similar configuration to this example?

If you could share the Fragment and REST Endpoint code that you are using, it would be helpful.

Also, could you please share the version of Jira and ScriptRunner that you are currently using?

 

Thank you and Kind regards,

Ram

Hi Ram, 

Yes, very similar to that example. Here's the REST EP.

 

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.transform.BaseScript
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
import groovy.xml.MarkupBuilder
import javax.servlet.http.HttpServletRequest

@BaseScript CustomEndpointDelegate delegate

testJiraQueryDialog(httpMethod: "GET", groups: ["jira-users"]) { MultivaluedMap queryParams, body, HttpServletRequest request ->

    def writer = new StringWriter()
    def xml = new MarkupBuilder(writer)

    String dialogTitle = "Query Jira/Confluence Database"

    xml.section(role:"dialog", id:"qu-dialog", class:"aui-layer aui-dialog2 aui-dialog2-xlarge", "aria-hidden":"true", "data-aui-remove-on-hide":"true" ) {
        header(class:"aui-dialog2-header") {
            h2(class:"aui-dialog2-header-main",dialogTitle)
        }
    }
    Response.ok().type(MediaType.TEXT_HTML).entity(writer.toString()).build()
}

 

 The fragment is a web item at system.admin.top.navigation.bar/system_admin_menu

and configured to "Run code and display a dialog" with the EP listed above.

I'm on SR 6.49 and Jira Data Center 8.20.8

 

 

 

Just got a response back from Adaptavist. This is a bug in Scriptrunner - https://productsupport.adaptavist.com/browse/SRJIRA-5868 

Hi @Tom Hudgins , did you ever figure this out? I am having the same issue. I had the dialog open modally fine before but a recent upgrade has broken it? Thanks for any advice you may have.

HI @Henry Brown,

A fix for this bug is already available in ScriptRunner version 6.52.0, as shown in the ticket: SRJIRA-5868.

I suggest that you upgrade your ScriptRunner plugin to the latest release, i.e. 7.1.0.

Thank you and Kind regards,

Ram

Yep @Henry Brown it's working for me now after updating Scriptrunner.

Hi @Ram Kumar Aravindakshan _Adaptavist_ , we are running ScriptRunner past 6.52.0 in our Confluence instance.

The issue I am having is that when I create a Custom Web Item to call a REST endpoint and display a dialog using the form with the "Run code and display a dialog" option selected, the web item works fine.

However, I would like to customize the component beyond what the form allows, so I copy the preview XML into a raw xml module. That is where the functionality fails. When the generated XML from the form is copied into an XML module, clicking the web item takes me to a full page display rather than a pop-up modal.

If it helps, this is for the confluence version of ScriptRunner and the web item is in the page.metadata.banner section.

Suggest an answer

Log in or Sign up to answer