We have created an Issue panel on JIRA issue view screen. What we need to render is a list of issue keys (which fetched by an API call).
This is how we define the Forge library manifest.yml file:
modules:
jira:issuePanel:
- key: dylan-hello-world-app-hello-world-panel
function: main
title: Forge App by Dylan
icon: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
trigger:
- key: issue-updated-trigger
events:
- avi:jira:updated:issue
function: issue-trigger-func
function:
- key: main
handler: index.run
- key: issue-trigger-func
handler: index.issueUpdatedTrigger
app:
id: our cloud app id
name: dylan-hello-world-app
permissions:
scopes:
- read:jira-work
My run() function does the the rendering part of the panel (initial render).
The issueUpdateTrigger(event, context) function will be triggered when issue updated event happens. By default, this function will automatically received event and context parameters from JIRA.
In the issueUpdateTrigger, we would like to call API again by passing in context to retrieve new issue keys list and also update the context of our existing panel. May I know how can we perform the regarding actions?
(I think It is a must to expose both run() and issueUpdatedTrigger() functions in the index file, cause this is how Forge reads the function, and therefore these two functions might not be able to share a common ancestor function.)
Appreciate your help and do let me know if more information is needed :D
Hi @Dylan Oh,
I've checked with the team and updating the app's view basing on the trigger state (or updating the trigger basing on the view code) is not possible.
Thanks,
Mateusz
I see, thanks for helping to reach out, Mateusz.
May we check in this case, is there any function that we can use to force refresh the issue panel inside our event listening function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately refreshing the issue panel is not possible inside event listening function. You may provide a button for users to refresh an issue using e.g. useAction https://developer.atlassian.com/platform/forge/ui-kit-hooks-reference/#useaction - when state of the hook is refreshed, the view is re-rendered.
Thanks,
Mateusz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dylan Oh
Hi Mateusz,
I see... thanks for explaining.
We are doing something like an issue panel to display information regarding the ticket, ,and therefore we would require the issue panel to listen for the event of issue updating and not the event that is happening within the app itself (like button onClick).
Can I also check with you is the function below catching JIRA Issue updating event? Because we have tested this for our app but it is not catching event from JIRA when we update the issue.
AP.events.onPublic('customPublicEvent', function(){
alert('public event fired');
});
Again, appreciate your input!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
unfortunately currently it's not possible using UI kit. But with CustomUI you can build your own UI with JS and use e.g. some interval polling / checking if the state changed.
Regarding the code chunk you've pasted - the AP is suggesting you're using the Connect JS API - https://developer.atlassian.com/cloud/jira/platform/about-the-connect-javascript-api/. It doesn't work on Forge.
Thanks,
Mateusz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's 2024 now...
Has this changed ?
Is it still impossible to get updates of current issue in a forge issue panel ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no, please see the accepted answer posted on 6th of April: https://community.atlassian.com/t5/Jira-Software-questions/How-to-update-Forge-UI-Issue-Panel-with-JIRA-Issue-update-event/qaq-p/1637873#M132280
Regards,
Mateusz
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.