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,295,560
Community Members
 
Community Events
165
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 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you