Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog screen

Dan27
Contributor
April 7, 2020

Hello,

 

I would like to create a dialog screen.

Can anyone send a template to it?

 

Thank you,

Daniel

1 answer

0 votes
Ste Wright
Community Champion
April 12, 2020

Hi @Dan27

In what context do you want to add a dialogue screen? For example, is it during a workflow transition? Or?

Ste

Dan27
Contributor
April 12, 2020

Just from a fragements button. with "bla bla" text. something simple.

 

I try to do it and the dialog opens in a blank page. attached pics of the fregments screen and the "dialog" blank page.

This is my rest endpoint code:

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
@BaseScript CustomEndpointDelegate delegate

doSomething { MultivaluedMap queryParams ->

// get a reference to the current page...
// def page = getPage(queryParams)

def dialog =
"""<section role="dialog" id="sr-dialog" class="aui-layer aui-dialog2 aui-dialog2-medium" aria-hidden="true" data-aui-remove-on-hide="true">
<header class="aui-dialog2-header">
<h2 class="aui-dialog2-header-main">Some dialog</h2>
<a class="aui-dialog2-header-close">
<span class="aui-icon aui-icon-small aui-iconfont-close-dialog">Close</span>
</a>
</header>
<div class="aui-dialog2-content">
<p>This is a dialog...</p>
</div>
<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-close-button" class="aui-button aui-button-link">Close</button>
</div>
<div class="aui-dialog2-footer-hint">Some hint here if you like</div>
</footer>
</section>
"""

Response.ok().type(MediaType.TEXT_HTML).entity(dialog.toString()).build()
}

This is my fragements script: (attached pic of the dragments screen):
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue;

return (issue.getIssueType().name=='Bug-Internal')

'Navigate to a link'
Link: /rest/scriptrunner/latest/custom/doSomething?issueId=$issueId&issueKey=$issue.getKey()dialogExample.JPGfragments- pic.JPG

Suggest an answer

Log in or Sign up to answer