How to access jira core feature in jira cloud app

Hi all,

I created an app using jira cloud (atlassian-connect.json). With the help of this tutorial I created app and installed.
https://developer.atlassian.com/cloud/jira/platform/getting-started/

So it’s restricted to one user. I want to build a plugin in organization level.

For eg in my organization have 10 people. All will install my app. If any user created any record(Submit form in my app) all other members in that company have to see that infomration.

How can I achieve this feature in cloud.
I want to get installed user organization details and members in each organization, projects and issues/tasks in it.

Please suggest.

What exactly do you mean by:

Apps are installed per instance, not per user. So your app only needs to be installed once. After that everybody on your instance should be able to use it. Simply display your data in a web panel or in a custom page and it should be visible for everyone.

1 Like

Hi Sven,

Yes. You are right. How can I get all users of that instance using rest api calls.

Hi @Sankar,

This endpoint https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-user-search-get might help you. You can try query= for all but take note of the pagination.

Cheers,
Anne

Hi Anne,

Tried this. Getting error Encountered a“403 - Forbidden”error while loading this page.

Hi @Sankar,

Does your app have the right permission? And when you go to General Settings -> Permission, is app group in “Browse Users and Groups”?

Cheers,
Anne

Hi @acalantog,
I haven’t found that setting. Can you please share screenshot of that navigation.

Hi @Sankar ,

Like this:

Cheers,
Anne

Gave permission but still same error.

From what context are you calling the endpoint? Can you share your code and the scope part of your atlassian-connect.json?

scope:

scopes":[  
      "read",
      "write",
      "act_as_user"
   ]

code:

AP.require("request", function(request) {
    request ({
        method: 'GET',
        url: 'https://experinator.atlassian.net/rest/api/2/users/search?query=',
         beforeSend: function(xhr) { 
              xhr.setRequestHeader("Accept", "*/*");
              xhr.setRequestHeader("Cache-Control", "no-cache");
              xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        },
       dataType: 'json',
       success: function(msg) {
             console.log(msg);
       },
       error: function(msg) {
              console.log(msg)
        }
     });
 });

Hi @Sankar,

In your payload, url can be relative so it looks like /rest/api/latest/user/search?query= and the API resolves it for you. And it’s /user and not /users. I don’t think you need the extra headers.

Please note that the AP.request`calls the endpoint on behalf of the user and not the app which means that the logged in user should have the right access and permission

Cheers,
Anne