Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

UI Modifications template not working for IssueView UIM Context

Kevin Setter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 29, 2023

I created an app type jira-ui-modifications from the forge cli templates using forge create. In that template in the main index.js file is the following code that registers project - issue - viewtype contexts.

The viewType GIC that comes with the template works. I can see console.log statements in the client side console for logging statements I put into these methods

uiModificationsApi.onInit(...) nor uiModificationsApi.onChange(..)

 

const result = await api.asApp().requestJira(route`/rest/api/3/uiModifications`, {

    method: 'POST',
    body: JSON.stringify({
      name: UI_MODIFICATIONS_NAME,
      contexts: [
        {
          projectId: '10100',
          issueTypeId: '10500',
          viewType: 'GIC'    <=== works when creating a new Issue
        }
      ]
    }),
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/json'
    }
  });
When I change the viewType to IssueView from GIC, it doesn't appear to work. I don't see any console.log statements from within the 
uiModificationsApi.onInit(...) nor uiModificationsApi.onChange(..)

 

const result = await api.asApp().requestJira(route`/rest/api/3/uiModifications`, {

    method: 'POST',
    body: JSON.stringify({
      name: UI_MODIFICATIONS_NAME,
      contexts: [
        {
          projectId: '10100',
          issueTypeId: '10500',
          viewType: 'IssueView'    <=== not working when viewing an Issue
        }
      ]
    }),
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/json'
    }
  });
Maybe I'm not understanding what IssueView means? I thought it meant when I open an Issue from the Issues list and View the details. I need the ui modifications change event to work on both creating and viewing an Issue.
Notes
- when I changed the viewType I uninstalled the app from the test site, re deployed and re installed. Then flushed cache in browser to test.
- I get a 201 returned from the API call above on registering the uiModifications
- I tried several combinations of contexts, both together, multiple calls to the API, etc...
I'm out of ideas (and running out of time).

1 answer

0 votes
MS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2023

Hi @Kevin Setter - where are you opening the issue? Please have in mind that we do not support all issue view locations yet (there's a lot of them), only 3 for now: 

  • Full page issue view
  • Board issue view
  • Backlog issue view

can you attach the screenshot/url path after page address where you are opening the issue? Then I will be able to detect the Issue View location and provide information if it's supported.

Thank you

Kevin Setter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2023

Since Board is supported I went to the 'Board' for my project and opened an issue from the board. 

Still no activity (console.log statements visible). The Create button does produce activity still.

Annotation 2023-11-30 130034.png

Let me know if I'm still not opening a supported view. 

Thanks

MS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 1, 2023

@Kevin Setter it is a supported view. We are trying to reproduce it on our side, we will come back to you with the findings. In the meantime could you please try to use UI modifications example app: https://bitbucket.org/atlassian/forge-ui-modifications-example/src/master/, there's an admin panel and it works well for Issue View.

Thank you 

MS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 1, 2023

@Kevin Setter we tried to reproduce it multiple times in various scenarios and for us the problem appears only in one scenario: when we forget to run `forge deploy` before reinstalling the app. Can you please check:

- `forge deploy` after changing `GIC` to `IssueView`

- `forge uninstall` 

- `forge install` to trigger the creation of UIM with a context 

and let us know if it fixes the problem? 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events