Dialogs not being found (Jira Cloud)

We have a dialog in our Jira cloud app.
However when we configure it as a dialog (under module:dialogs within our json connect) we get the error :

"The content resolver threw the following error:
Unable to retrieve addon module URL. Please check your specified module key."

If we configure it in our connect file as a generalPages or as a jiraProjectPages, it is found (but it then appears as a menu item which we don’t want)

It seems as if connect dialogs are not being indexed as keyed and findable content.

Hi @colin.hammond,

Can you please provide more details. How are you attempting to open the dialog? Is it through a web item referring to it? If so, can you please provide the dialog and web item definitions from your Connect descriptor. Alternatively, if you’re attempting to open it from the JavaScript API, please provide your dialog definition and your JavaScript code you are attempting to open it with.

Regards,
Dugald

Sure… here is the relevant part of the connect file:

 "modules": {
		 
		 
	     "dialogs": [
		 
	         {
	             "key": "scopemaster-story-zoom",
				 "conditions": [
				                    {
				                        "condition": "user_is_logged_in"
				                    }
				                ],
			
				"url": "jig_page?project_id={project.id}&project_key={project.key}&issue_id={issue.id}&issue_key={issue.key}&issue_typeid={issuetype.id}&display=zoom"       
           
	            ,
	             "name": {
	                 "value": "ScopeMaster Analysis Zoom"
	             }
	         }
		 ],
		 
		 

We load from javascript from within a webpart.

	
	
	AJS.$(".dialog-show-button").click(function(e) {
	    e.preventDefault();
		
		
	    AP.require('dialog', function(dialog){
	      dialog.create({
			  key: 'scopemaster-story-zoom',
			  width: '820px',
			  height: '480px',
			  chrome: true
	      }).on("close", callbackFunc);
	    });
		
	});
	

We also tried just this

	AP.dialog.create({
		  key: 'scopemaster-story-zoom',
		  width: '820px',
		  height: '480px',
		  chrome: true
		}).on("close", callbackFunc);

The javascript works fine if it is declared as a generalPages or as a jiraProjectPages within the connect file but not if it is defined as a dialog.

Hi @dmorrow, do you have any insight on this?

Hi @colin.hammond,

I don’t know how to interpret the following statement:

The javascript works fine if it is declared as a generalPages or as a jiraProjectPages within the connect file but not if it is defined as a dialog.

Can you unpack this for me.

Regards,
Dugald

Hi @colin.hammond,

With regard to the error you are observing:

Error: The content resolver threw the following error:
Unable to retrieve addon module URL. Please check your specified module key.

I think this occurs when your dialog options references a module key that your app doesn’t declare in its Connect descriptor.

You should see an error in your browser’s console that looks as follows:

POST https://yourtenant.atlassian.net/plugins/servlet/ac/your-app-key/referenced-module-key 404

Check that your app descriptor contains a module with a key referenced-module-key.

Regards,
Dugald

Hey @colin.hammond, do you see any errors when you upload your descriptor? The reason I ask is that, according to the doco, the Dialog module doesn’t have ‘conditions’ or ‘name’ attributes.

2 Likes

@david.pinn Thanks for your comment. There was no error with the install. On your suggestions I have removed the conditions and name attributes from the connect file. Just trying to get it deployed so I can test if this helps.

Am now bumping into the “could not be installed as a local app as it has previously been installed from Atlassian Marketplace”. Which is strange because it never was installed locally on this particular instance.

Hi Dugald,
I do have a descriptor as per the extract of the connector above.

I am trying David’s suggestion of removing the attributes in the connector that appear unavailable for dialogs.

Unfortunately I can’t get that proven as I am now bumping into a different problem, see below. And stuck again. It would nice if there were some better diagnostics tools available for cloud app developing to help the reduce the need for so much trial and error.

For anyone else who encounters this problem, the dialog module allows you to add options (for size). It turns out the options are not optional. If you exclude the options in your descriptor, the dialog will not be found.

In short - options are not optional but mandatory in the descriptor.

1 Like