Invoke Create Issue dialog from my add-on

Hi there,

I need to invoke the native JIRA’s Create Issue form from my add-on. Can you advise on a recommended way to do it?

Thanks!
Piotr

1 Like

https://developer.atlassian.com/static/connect/docs/latest/javascript/module-jira.html

openCreateIssueDialog(callback, fields)

Does that help?

3 Likes

Thank you Nick, yes it does!

For some reason when it comes to Atlassian Connect I lived in the world of REST APIs and not realized the js library funcitonality :smile:

3 Likes

Hi Nick,

We used the function you provided and yes it works, so thanks for advice. What is worrying me a bit is that we are getting a warning that the function is deprecated. The official documentation of the library does not mention this fact. Any comments on this?

> DEPRECATED API - AP.require() has been deprecated since ACJS 5.0 and will be removed in a future release. No alternative will be provided.

Also, is there a way to invoke similar dialog for SubTasks?

1 Like

Hi guys,

additionally invoking jira.openCreateIssueDialog(...) keep throwing ReferenceError.

      AP.require('jira', jira =>
      {
        jira.openCreateIssueDialog(issues => {
          if(issues[0] != null)
            console.log(issues[0]['fields']['summary']);
          else
            console.log("Issue creation cancelled");
        })
      });
ReferenceError: openCreateIssueDialog is not defined
    at Object.AP.jira.openCreateIssueDialog.AP._hostModules.jira.openCreateIssueDialog (all-debug.js:3363)
    at main.d3fc1de….bundle.js:1
    at addOne (all-debug.js:2779)
    at reqOne (all-debug.js:2796)
    at reqAll (all-debug.js:2785)
    at Object.require (all-debug.js:2874)
    at all-debug.js:2914
    at Combined.require (all-debug.js:2069)
    (...)
  // .../atlassian-connect/all-debug.js
  var original_openCreateIssueDialog = AP._hostModules.jira.openCreateIssueDialog.bind({});
  AP.jira.openCreateIssueDialog = AP._hostModules.jira.openCreateIssueDialog = function (callback, fields) {
    original_openCreateIssueDialog(fields, callback);            //ok, showing dialog
    openCreateIssueDialog(fields, callback);                     //throw error
  };

Removing line “openCreateIssueDialog(fields, callback);” from all-debug.js prevent this error and dialog appears same way as with this line. Also callback works fine.


Am I doing something wrong with jira.openCreateIssueDialog(...)?

2 Likes