Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update Forge UI Issue Panel with JIRA Issue update event listener function?

Dylan Oh I'm New Here Mar 14, 2021

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

2 answers

1 accepted

0 votes
Answer accepted
Mateusz S Atlassian Team Apr 06, 2021

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

Dylan Oh I'm New Here Apr 06, 2021

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?

Mateusz S Atlassian Team Apr 07, 2021

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

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!

Mateusz S Atlassian Team Apr 09, 2021

@Dylan Oh

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

0 votes
Mateusz S Atlassian Team Apr 01, 2021

Hi @Dylan Oh

 

I'll gather information and we'll come back to you with an answer :) 

 

Thanks,

Mateusz

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

283 views 16 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you