Hi,
I'm currently searching for a solution with regards to the following problem.
- Goal: I wanted to implement a custom dialog (using Scriptrunner) where the User can select issues from a predefined dynamic selection list of issues (more or less like an Issue picker) and after he/she submits the dialog, the system links the current issue with the selected issue with a specific link type.
- Hints according to the implementation: I reused the dialog-examples of the Scriptrunner documentation as well as some hints from the AUI documentation (e.g. according to dialog 2). I generated one REST Endpoint with the script and the Javascript to build the dialog. The REST Endpoint can be triggered by a Web Item - a menu entry in the "More" sequence of the issue detailed view. The links are generated by using REST api in the Javaspript functions concerning the submit button.
- Current status: The dialog works fine so far - Selection list is generated correctly, the user is able to select issues, the submit-button leads to the wanted links.
- Problem: After submitting the dialog, the issue detailed view is not refreshed correctly. In my first attempts, there was no refresh and one always had to use F5 to see the linked issues correctly in the "Issue Links" section. I added then the Jira triggerJIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]); but this leads only to a presentation of the last selected issue to be linked (the user is able to link n issues with the current issue). I also tried to generate an additional Endpoint with an temporaryRedirection response (idea from Adaptavist support), but this also doesn't helped so far.
Also Window.location.reload() or similar functions did not help. Only pushing F5 leads to the presentation of all linked issues. Or in case I delete one of the links after the dialog has been submitted, the link-container is refreshed correctly
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