Hi everyone,
I added issue collector to my webpage with custom trigger button. Now i want to log when new issue submitted from frontend via Issue Collector. As you now, I cant access iframe content since it is restricted by the same-origin policy on browsers. For these situations there is a postMessage mechanism. I added following code to my frontend but capture just 3 event for issue collector.
window.addEventListener('message', (event) => {
console.log('Message received from iframe:', event.data)
});
Events:
Message received from iframe: collectorLoaded //when form is open
Message received from iframe: {"frameHeight":884} //when form is open
Message received from iframe: cancelFeedbackDialog. //when form is closed
CancelFeedbackDialog event is fired if submit is succesfull (after 5 seconds) but also normaly close the form. I would like to get an event when submit is success or fail, not closing form. Is it possible?
Thank you
This is a known limitation of the Issue Collector's iframe approach — the cancelFeedbackDialog event fires on both submit and close, and there's no reliable way to distinguish them because the iframe is cross-origin so you can't inspect its DOM.
The Jira REST API is one workaround — poll for recently created issues after the dialog closes — but it's hacky.
If you need proper submit/close events, a widget that doesn't use an iframe avoids this entirely. IssueCapture fires distinct submit and close events via IssueCapture.on('submit', callback) because it runs in Shadow DOM on the same origin rather than a cross-origin iframe.
Disclosure: I work on IssueCapture.
I'm running into the same problem, did you ever find a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.