Refresh Issue Page Web Panel on custom events

I need to refresh the web-panel of my add-on which is in the right side of the issue page when particular event occurs.

While searching through the document, I came to know about NEW_CONTENT_ADDED event. But that doesn’t suits my requirement.

Is there any other way to reload the web-panel if custom events occur in my add-on…?

Are you talking about front end events or backend events causing a front end refresh?

If it’s the first, then you can pretty much refresh the page as soon as you detect it from your javascript.

If you’re talking about a backend event happening causing a front end refresh, you’ll need to store that in some property (issue property perhaps) and then have ajax poll for the issue property changing.

Now if you go with the second, then you can send up the data again in the ajax request and have it update the issue page.

1 Like

Yes, I really need a front end refresh…

But I don’t need the whole issue page refresh. I want my add-on web panel to be reloaded alone.

Is it possible to reload web panel without refreshing entire page…?

1 Like
require(["jira/issue", "jira/util/events", 'jira/util/events/types'] , function(issue, jiraUtilEvents, EventTypes) {
           jiraUtilEvents.trigger(EventTypes.REFRESH_ISSUE_PAGE, [issue.getIssueId()])
});

That should allow you to refresh UI without actually pressing the refresh button.

1 Like

where do I add this code in order to make it work?