I had created a custom button using script runner fragments (custom web item). location 'operations-top-level'. Do what = Do nothing - you will use javascript to bind an action. Link = empty
(red = custom button, green - exsisting transition workflow button)
below is my script:
AJS.$(document).ready(function () {
var buttonClickHandler = function(e) {
e.preventDefault();
var actionUrl = "/secure/WorkflowUIDispatcher.jspa?id="+JIRA.Issue.getIssueId()+"&action=511";
var atlToken = AJS.$('input[name="atl_token"]').val();
const workflowLink = document.createElement('a');
workflowLink.href = actionUrl+"&atl_token="+atlToken;
workflowLink.style.display = "none";
document.body.appendChild(workflowLink);
workflowLink.click();
document.body.removeChild(workflowLink);
}
AJS.$("#jira").on("click", "#update-ratings-button", buttonClickHandler);
});
when I clcik on original button, it will open a pop up dialog screen look like this:
but when i clcik on the custom button it open the transition to whole new page:
so is there a way to make it open in dialog screen as the original one? or other alternative bring the original buttton outside from dropdown. but only for this specific button. since other transition need to be kept in dropdown.
my main objective is to bring the button in issue view screen, for easy access
Hi @Muhammad Muzakkir Abdul Malek
If you intend to invoke a Dialog via ScriptRunner's Fragment Web Item, I suggest following the steps in this ScriptRunner Documentation. You will need to make a REST Endpoint request to the transition screen and add the javascript to it.
I hope this helps to answer your question.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.