I’m working on an Angular app and using the ngx-jira-issue-collector package. It’s working fine, but I want to change how it opens. Right now, it shows up in a modal window. I’d like it to open in a new tab instead.
I tried using the direct link from the modal, but it’s not working quite right. The fields aren’t getting filled in, and the close button doesn’t work.
Is there a better way to do this? How can I make the issue collector open in a new tab and still work properly? Any help would be great!
While the previous answer offers a good workaround, there’s another approach worth considering. Instead of completely abandoning the ngx-jira-issue-collector package, you could leverage its API to get the best of both worlds.
Try modifying your openIssueCollector() method like this:
This method uses the package’s built-in functionality to generate the correct URL, including all your custom fields and settings. It then opens that URL in a new tab.
This approach maintains the package’s benefits while achieving your goal of opening in a new tab. It’s more maintainable and less prone to breaking if Jira’s URL structure changes in the future. Just ensure you’re using the latest version of ngx-jira-issue-collector for best compatibility.
I’ve actually faced a similar challenge with ngx-jira-issue-collector in one of my projects. From my experience, the package doesn’t natively support opening in a new tab, as it’s designed for in-page interactions.
However, I found a workaround that might help. Instead of using the package’s built-in functionality, you can create a custom button that opens a pre-filled Jira issue form in a new tab. Here’s how I did it:
First, construct the Jira issue URL with your server and project details.
Add query parameters to pre-fill fields.
Use window.open() to launch this URL in a new tab.
Here’s a rough example of how the openIssueCollector() method could look:
This approach gives you more control over the process and ensures it opens in a new tab. The downside is you’ll need to manually handle any custom fields or logic you had in your original setup. But in my case, it was worth the trade-off for the improved user experience.