Problem in setting up the admin page for Jira app

Hi Team

Facing issue in setting the admin page in manifest file
It would be helpful if there is any example for jira adminpage.
Kindly find the code of manifest below.

modules:
jira:issuePanel:
- key: hello-app-hello-world-panel
function: main
title: forge app
icon: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
function:
- key: main
handler: index.run
jira:adminPage:
- key: admin1
function: adminmain
title: admin page
useAsConfig: true
function:
- key: adminmain
handler: index.run

app:
id: ari:cloud:ecosystem::app/c6455100-0ea7-4d4d-aee4-2d10cb8ec9fd
runtime:
snapshots: true
permissions:
scopes:

When i try to run the file getting below.

16:-56 error manifest.yml failed to parse content - duplicated mapping key valid-yaml-required

Error: Command failed due to validation error.

Rerunning the command with --verbose may give more details.

Thanks in advance

Hi @PavithraSelvaraj,

When you fun forge create, Forge CLI suggests you starting from the template. One of the suggestions is the admin page, so you may create a new app just to see how the manifest looks like.

Unfortunately, the manifest you provided can’t be verified because of indentation, could you please use a proper formatting for it (it is called “preformatted text” in the toolbar)?

Thanks,
Vitalii

1 Like

If you define a function in the modules block, then there are only 2 scenarios for using the function keyword.

  1. Say, you have defined a resource field in the module and then the same resource should be defined in the resources block whose indentation is similar to that of modules block

For eg:

modules:
      jira:issueActions:
         -key: hello-world
         resource: exampleFunction

resources:
      -key: exampleFunction
      path: static/app/dist    

2. A function keyword is used inside the modules block if and only if you are using a resolver function for the custom UI app. And that also, it come with the resolver block

modules:
      jira:issueActions:
         -key: hello-world
         resource: exampleFunction
         resolver:
             function: resolverFunc

      function:
         -key: resolverFunc
          handler: index.handler       

resources:
      -key: exampleFunction
      path: static/app/dist    

And as I can see you have used the function keyword in the modules block without any resolver keyword. So, I guess there is the problem.

Moreover, as @vpetrychuk told, do share a properly indented manifest file. I hope the above examples may help you in debugging

2 Likes