Create a custom issue type

Hi,
I’m working on a Jira Cloud application using Forge and Custom UI.
As part of the app functionality, I need to create a custom issue type. This new issue type should be available when installing the application.

Any idea how to do it? I know how to create modules and UI components, but this issue type should not depend on any module, but more related to the entire app.

According to the official docs, this is how I should do it:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-post

But my question is WHERE should I add this call in my app?

Thanks,
Amit

Hi Amit,

I’m looking into this now for you.

Jordan

Thank you @JordanKoukides :slight_smile:

Basically, I need to know if I can run some code when the app gets installed.

Hi @amityahav !

As I understood correctly you want to make a REST call when the app gets installed - that it is not possible. The only ideas which comes to my mind how to achieve it:

  • show the warning indicator in your app that the issue type is not available (simple rest call for issue types) and add some button to easily add it (also simple rest call)
  • maybe some jira:adminPage when the admin could create needed issue type
  • my last idea is to use webtrigger module and trigger it once the app is loaded for the first time

I hope it would be helpful. :slight_smile:
Of course we will think about introducing feature that you described however for now it is not possible.

2 Likes

Thank you @KamilRichert & @JordanKoukides for your help!
I will definitely check the suggested solutions :slight_smile:

Hi @KamilRichert,

Can you please elaborate on the third option?
As far as I know, web triggers are external to the app, so how can I get the app-first-loaded event?

@amityahav hmm I was thinking about simple useEffect which will do the trigger and then use https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/ to store that the app is already loaded.

Hi @KamilRichert,

I get the app’s storage part of your solution, but I’m not sure about the useEffect that should trigger it.
In my app, I have an issuePanel module that should only be displayed if the user selected the custom issue type that I want to add. I need to create this custom issue type somehow when the app loads. Any idea how?