Hi,
I'm currently searching for a solution with regards to the following problem.
My question: which function can/should I use to refresh the link section or complete detail view after or during submitting the dialog? Or in other words, what can I do that "F5 will be pushed" after the dialog has been submitted ;-)
I spended a lot of time in try&error without success and thus I would appreciate a solution idea very much!
Thanks in advance!
Best, Günter
Hi @Günter Halmans , I don't know the answer, but you may be able to find some hints here as well: https://community.developer.atlassian.com/
Hi Carlos,
unfortunately, I did not found a solution there...but thank you for this hint!
Best,
Günter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please share the current code you are working with, along with some screenshots of the issue you are facing?
I will review it and provide some feedback.
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.
Hi Ram,
thank you in advance for giving me your feedback!
Please find enclosed (see below):
I'm looking forward to your ideas!
Best regards,
Günter
1. pic01:
2. pic02:
3. pic03
4.pic04:
5. code:
showLink_Dialog {MultivaluedMap queryParams, String body, HttpServletRequest request ->
// section in which the selection list is generated --> optionString
dialog =
"""<section role="dialog" id="my-own-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">Assignment of Issues to current Issue</h2>
</header>
<div class="aui-dialog2-content">
<p>Please select one or multiple Issues from the following list:</p>
<form class="aui">
<select id="select2-example" multiple style="width:80%">
${optionString}
</select>
</form>
</div>
<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-close-button" class="aui-button aui-button-link">Cancel</button>
<button id="dialog-submit-button" class="aui-button aui-button-primary">Assign selected Issue(s)</button>
</div>
</footer>
<script>
AJS.\$("#select2-example").auiSelect2({
placeholder:'Select Issue(s)...',
allowClear: true,
width:'resolve',
search:true,
});
var resultSelection = AJS.\$('#select2-example').on('click', function () {
console.log("Selected values are: " + AJS.\$(this).auiSelect2('val'));
return AJS.\$(this).auiSelect2('val');
});
(function (\$) {
\$(function () {
AJS.dialog2.on("show", function (e) {
var targetId = e.target.id;
if (targetId == "my-own-dialog") {
var someDialog = AJS.dialog2(e.target);
\$(e.target).find("#dialog-close-button").click(function (e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
someDialog.hide();
someDialog.remove();
});
\$(e.target).find("#dialog-submit-button").click(function (e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
var homeUrl = "${baseUrl}/browse/${currentIssueKey}"
const arrayIssues = resultSelection.val().toString().split(",")
for (let i = 0; i < arrayIssues.length; i++) {
var url = "${baseUrl}/rest/api/2/issueLink";
var data = {
"type": {
"name": "CoW"
},
"inwardIssue": {
"key": "${currentIssueKey}"
},
"outwardIssue": {
"key": arrayIssues[i]
},
}
data = JSON.stringify(data)
let xhr = new XMLHttpRequest();
xhr.open("POST", url);
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("X-AUSERNAME", "${user}");
xhr.setRequestHeader("X-Atlassian-Dialog-Control", "DONE");
xhr.onload = () => console.log(xhr.responseText);
xhr.send(data);
}// of for i...
someDialog.hide();
someDialog.remove();
JIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]);
});
}
});
});
})(AJS.\$);
</script>
</section>
"""
Response.ok().type(MediaType.TEXT_HTML).entity(dialog.toString()).build();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.