youngmon/atlassian-qna huggingface dataset:
How do I set default permissions for different spaces?
Asked by Mike Hagesfeld:

*This question is in reference to Atlassian Documentation: [Space Permissions Overview](https://confluence.atlassian.com/pages/viewpage.action?pageId=139521)*

We have different groups using our Confluence, and don't want to swamp them with each other's spaces. We create spaces fairly frequently, and as such I would like there to be a way to set up different spaces for the different groups, i.e. if the space is a "Dev Space" permissions are given to the Dev group, and if it's an IT space permissions are given to the IT group.

Is there any way to do this?


Answers:
author: James Dellow
body: You can assign users to groups, then assign those groups to spaces to grant permissions. However, the group itself doesn't have any particular rights or permissions. You can assign a group to one space with a particular set of permissions, then use it in another space with different permissions.

However, by default your Confluence site is probably setup to assign access to the "confluence-users" group when you create a new space. That is a special system group containing all users - you either need to remove this from the space after you create it or edit the default permissions under *Site administration \> Space Permissions*.

Out of the box its is a manual process to manage spaces with different permissions, but automation is possible.

Remember that by doing this, users that aren't explicitly given access to a space won't be able to see any activity or search for any of the content in it. Are you categorising spaces to help them filter them? See <https://confluence.atlassian.com/confcloud/use-labels-to-categorize-spaces-724764814.html>


Tags: cloud

permission

space
Watch pages
Asked by andrew_kondratov:

*This question is in reference to Atlassian Documentation: [Watch Pages, Spaces and Blogs](https://confluence.atlassian.com/pages/viewpage.action?pageId=139579)*

What about multiple pages at once? I want to watch a page and all its children, but not the entire space


Answers:
author: Thomas Schlegel
body: Hi Andrey,

we are using the Tree View Plugin for that (<https://marketplace.atlassian.com/plugins/de.edrup.confluence.plugins.tree-view/server/overview>)

It's free and works great.


author: Rodney Hughes
body: Good question .... :smile:

Sounds like a new feature request .. maybe already requested?


Tags: page

watch
Confluence Data - Trying to override existing database
Asked by Adejumo Magbagbeola:

*This question is in reference to Atlassian Documentation: [Using the JIRA application configuration tool](https://confluence.atlassian.com/pages/viewpage.action?pageId=861254029)*

Clicking on upgrade (Confluence), now i cant connect to my database, Confluence is asking me to set up data base again when i already have an existing database.

The following error(s) occurred:

* Confluence tables already exist in the selected database.

What will be the best way of knowing or pointing confluence to the right database ?

Should there not be a choice to choose this from the installation wizard ?


Answers:
author: Ornaldo
body: Hello, i'm facing the same problem. I'm installing a new confluence instance. the oracle db is on the same server as the jira confluence. also in this server we have installed another jira ( not confluence) with oracle db


author: Nic Brough -Adaptavist-
body: No. What you're doing is trying to connect an unconfigured Confluence to a configured one. It cannot know whether you need to go through the setup again or not.

Your next step should be to connect this Confluence to an **empty** database.

comments: author: Adejumo Magbagbeola
body: NO I am not trying to connect to an unconfigured confluence.

Like i said Confluence was up and running before the upgrade. After a restart on the server, Confluence went straight to the configuration page asking me to configure database. And this is why i am concerned with this action from Confluence

Every other i installed worked fine with the existing database, why not confluence ?


author: Nic Brough -Adaptavist-
body: That's not what the system is telling you, although you've misread what I said and got it the wrong way around.

Your Confluence is not configured, as it believes it needs to set up the database, but it's trying to connect to one with data in it. So it's complaining because it doesn't know what you want.


author: Abdelali Boumalek
body: I have the same issue, I setup Confluence for the first time and want to setup a DB and receive the message that Database Contains Existing Confluence Data - Confluence Confluence tables already exist in the selected database. The only thing that I have did was create manually the DB in MS Sql, I dont understand why I receive this message as i didn't create the table.


author: Nic Brough -Adaptavist-
body: You've pointed it to a database that has already been set up by a Confluence installation.

You need to point the installer at an empty database.


author: Abdelali Boumalek
body: and how I can override without the drop the DB?


author: Nic Brough -Adaptavist-
body: You don't. You need to point a new Confluence installer at an empty DB. Either drop the tables in the existing one, or create a new empty one.


author: Andrew
body: What if those tables contain valuable organizational information (as one usually does when they're using this product) and we can't drop the tables?


Tags: documentation
If remote API is enabled by default, how to secure
Asked by Atflex:

Hello,

If remote API is enabled by default how can this be secured?

Does the REST follow the security structure of my Cloud instance?

How do I prevent users to extract data via API/REST from my confluence instance?

Regards,

Alexander


Answers:
author: Nic Brough -Adaptavist-
body: The REST API has the same security as the web-ui, it respects all the permissions etc.


author: Robert Massaioli _Atlassian_
body: > How do I prevent users to extract data via API/REST from my confluence instance?

What prevents your users from simply scraping pages that they can see?


Tags: cloud

confluence-cloud
Overview of my environment
Asked by Atflex:

Good afternoon,

As a site administrator I am in need of report / overview of my environment, like:

* When was a space last used / openened
* Last time a page or contribution was made to a page in a space
* How many pages are in a space
* Overview of all attachements, size of them, owner
* Capacity used (storage)
* etc.

Where can I find all of this or how can I create reporting on this.

Regards,

Alexander


Answers:
author: Rob Woodgate
body: Hi Alexander,

This is a very common question. Usage stats and logging are amongst the [restricted functions in Confluence Cloud](https://confluence.atlassian.com/confcloud/restricted-functions-in-confluence-cloud-734070955.html).

However there are Cloud add-ons for both user analytics and instance auditing, such as this popular [analytics add-on](https://marketplace.atlassian.com/plugins/com.addonengine.analytics/cloud/overview) and [this list](https://marketplace.atlassian.com/search?application=confluence&category=&cost=&hosting=&marketingLabel=&q=audit) of auditing add-ons.

comments: author: Sandy Johnson
body: Hi Rob, Would your answer be different for the server version?

Thanks


author: Rob Woodgate
body: Hi Sandy,

Yes it would :smile:

The server version has [site statistics available](https://confluence.atlassian.com/doc/viewing-site-statistics-123043962.html), and [this page](https://confluence.atlassian.com/confkb/how-do-i-get-more-statistics-from-confluence-154239308.html) gives you lots more options for generating more stats/data. You can also implement Google Analytics, or whatever your favourite analytics tool is, in server, which you can't do in Cloud (because you need to add a tag to the pages and you can't do that in Cloud).


Tags: cloud

confluence-cloud
Can I customize/disable specific editor keyboard shortcuts in Confluence?
Asked by Niels Bom:

I'd like to customize or disable a specific editor keyboard shortcut in Confluence.

Can I? If so: how?

I'm on a Mac so Cmd-1 switches to the first browser tab but Confluence overrides this command by making the current text a Header-1. Not very handy.


Answers:
author: Rob Woodgate
body: Hi Niels,

You can turn off the keyboard shortcuts in your Profile \> Settings, but this won't turn off the editing shortcuts. You can also [selectively turn off individual keyboard shortcuts](https://confluence.atlassian.com/confkb/how-do-i-disable-keyboard-shortcuts-system-wide-in-confluence-321850378.html), but only in the server version.

There's an open ticket asking for the ability to turn off editor keyboard shortcuts: <https://jira.atlassian.com/browse/CONF-21908>

comments: author: Vick Khera
body: The link to selectively turn off shortcuts is now a missing page. :(


Tags: cloud

confluence-cloud
Improving startup performance with OJDBC, an Oracle DB, and Confluence
Asked by Randall Fisher:

During the startup of Confluence, the following query (among others) is being called repeatedly:

SELECT NULL AS pktable_cat,

p.owner as pktable_schem,

p.table_name as pktable_name,

pc.column_name as pkcolumn_name,

NULL as fktable_cat,

f.owner as fktable_schem,

f.table_name as fktable_name,

fc.column_name as fkcolumn_name,

fc.position as key_seq,

NULL as update_rule,

decode (f.delete_rule, 'CASCADE', 0, 'SET NULL', 2, 1) as delete_rule,

f.constraint_name as fk_name,

p.constraint_name as pk_name,

decode(f.deferrable, 'DEFERRABLE', 5, 'NOT DEFERRABLE', 7, 'DEFERRED', 6) deferrability

FROM all_cons_columns pc, all_constraints p, all_cons_columns fc, all_constraints f

WHERE 1 = 1

AND f.table_name = :2

AND f.owner = :4

AND f.constraint_type = 'R' AND p.owner = f.r_owner

AND p.constraint_name = f.r_constraint_name

AND p.constraint_type = 'P'

AND pc.owner = p.owner

AND pc.constraint_name = p.constraint_name

AND pc.table_name = p.table_name

AND fc.owner = f.owner

AND fc.constraint_name = f.constraint_name

AND fc.table_name = f.table_name

AND fc.position = pc.position

ORDER BY pktable_schem, pktable_name, key_seq

Unfortunately, this query is taking 1:30-2:00 minutes to execute.

This is just one of the 'SYS' tables that is being queried. Because of it's long running time, it has floated to the top of the list of concerns. This SQL is generated by getImportedKeys() method of DatabaseMetaData class in OJDBC.

From what I have learned, Confluence is not making this query directly. It is calling a method in JDBC and the client is in turn making the query.

We have recollected Data Dictionary stats, but that has not improved performance.

Any ideas on how to improve performance in this area?


Answers:
author: Randall Fisher
body: We currently are using the following two views to achieve ++some++ performance gain.

```
create or replace view confdb50.all_constraints as
 select "OWNER",
?"CONSTRAINT_NAME",
?"CONSTRAINT_TYPE",
?"TABLE_NAME",
?"SEARCH_CONDITION",
?"SEARCH_CONDITION_VC",
?"R_OWNER",
?"R_CONSTRAINT_NAME",
?"DELETE_RULE",
?"STATUS",
?"DEFERRABLE",
?"DEFERRED",
?"VALIDATED",
?"GENERATED",
?"BAD",
?"RELY",
?"LAST_CHANGE",
?"INDEX_OWNER",
?"INDEX_NAME",
?"INVALID",
?"VIEW_RELATED",
?"ORIGIN_CON_ID"
 from sys.user_constraints;
```

```
create or replace view confdb50.all_cons_columns as
 select "OWNER",
?"CONSTRAINT_NAME",
?"TABLE_NAME",
?"COLUMN_NAME",
?"POSITION"
 from sys.user_cons_columns;

CONFDB50 is the schema where that our Confluence install runs against.
```

Atlassian support does not recommend these two views (of course).


Tags: confluence-administration
Is it possible to use Confluence Macros in the Word origin file?
Asked by BenGeigerOwv:

*This question is in reference to Atlassian Documentation: [Importing a Word Document into Confluence](https://confluence.atlassian.com/pages/viewpage.action?pageId=658736950)*

In my originating Word document I want to use (somehow) the page properties plugin. My expectation is surely not that it works in Word but it should work in Conluence after having imported the Word file.

Tanks to Rob's answer I can refine my question: **I do not expect it to work in in the Word document** . Additionally I don't want to attach a Word file. Instead I want to **import** one.

The refined question is: can I add wiki markup in the Word document, so that **after** the import the confluence page displays the macro corretly?

Regards, Ben


Answers:
author: Rob Woodgate
body: Hi Ben,

You can't.

The Page Properties Report looks for Confluence pages with a specific label (or combination of labels) and when it finds a matching page it takes the information from the Page Properties macro on that page. It won't look inside a Word document for a macro because a) it wouldn't make sense to look in a Microsoft file for an Atlassian macro, and b) that's not how the macro (or any macro) works.

comments: author: BenGeigerOwv
body: Hi Rob,

thank you for your answer. Unfortunately that is not what I meant. As I posted already in my question **I do not expect it to work in in the Word document** . Additionally I don't want to attach a Word file. Instead I want to **import** one.

The question is: can I add wiki markup in the Word document, so that **after** the import the confluence page displays the macro corretly?

Regards, Ben


author: Rob Woodgate
body: Hi Ben,

Thanks for the clarification. Confluence [changes the wiki markup into rich text format as you type](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html), so whilst you can type markup directly, I don't know what would happen if you import it as text. At the risk of asking a silly question, have you tried writing a line of markup and importing it into a page to find out what happens?


author: Davin Studer
body: It would not render your wiki markup. It would make it plain text. Won't work.


author: Rob Woodgate
body: Thanks Davin.

Ben - It looks like it can't be done I'm afraid.


author: Lissa Meade
body: I just discovered that yes, you can. It's not automatic, but it works if you need it.

1. Copy the Wiki Markup and paste it into your Word document. You can find your macro and its markup by going here: <https://confluence.atlassian.com/doc/macros-139387.html>
2. Select the text and clear formatting
3. Import the document.
4. Edit the new page
5. Delete the ending } symbol, and then re-add it

And presto: The macro pops up where the Wiki Markup was.


author: BenGeigerOwv
body: Conclusion: there is no possibility to have wiki markup imported from a word document so that it is functional in confluence.

Thanks for all that contributed!

Regards, Ben


Tags: documentation
How do I remove the Instant Websites advertisement from the bottom of the published site?
Asked by Chris Rehberg:

For a paid service, I'm surprised there is an advertisement on the published website.


Answers:
author: Davin Studer
body: That's not Atlassian. You must have some browser extension or something that is adding in the add. Atlassian doesn't advertise on your site.

comments: author: Davin Studer
body: Oh, I see Instant Websites is an add-on for Confluence Cloud. Looks like you can add CSS to the site so you should be able to hide it.


author: Chris Rehberg
body: Thanks David. The obvious answer!


Tags: cloud

confluence-cloud

instant-website
How to mask a password in macro browser?
Asked by S K Bera:

During insertion of a plugin macro in Confluence page, a password is input through Macro Browser by the editor of the page and the password remains exposed to other editor of the same Confluence page.

That's why it's better to mask the password. But the parameter options seem to have no such facilities presently.

What I need is support for type="password" as parameter options.

If suitable parameters option is not available, what is the alternative?


Answers:
author: Davin Studer
body: So, there are a couple things that you should think about regarding this since you are developing the add-on yourself. If you truly want to hide the password from your users, then you probably don't want to do this the way you are thinking as the password would be stored in clear text in the Confluence storage format (which is easily accessible from https://yourserver/plugins/viewstorage/viewpagestorage.action?pageId=#####). Not only that your users could easily get the password with a very small amount of javascript run from the browser's dev console. A more typical approach would be to create a place in Confluence Admin where an admin could create canned SQL connections. Then in your macro you provide your users a drop down to select which connection they want. That would be a better method to secure your passwords. The way you are going about it would not be secure at all.


author: S K Bera
body: Thanks for clear explanation. I would try to create data sources in Confluence Admin to be later used from application.


author: S K Bera
body: I'm using confluence SDK environment for plugin development. My plugin is based on the setup created by the command "atlas-create-jira-plugin-module".


author: Davin Studer
body: What is the add-on name, or is this something y'all have made yourselves?


author: S K Bera
body: It's a macro plugin for Confluence to query external database. Its parameter list goes like this in file "atlassian-plugin.xml":

\<xhtml-macro name="database-query" class="com.atlassian.tutorial.macro.DatabaseQuery" key="database-query-macro"\>  
\<description key="database-query.macro.desc"/\>  
\<category name="formatting"/\>  
\<parameters\>  
\<parameter name="Database_Type" type="enum"\>  
\<value name="MySql"/\>  
\<value name="Oracle"/\>  
\</parameter\>  

\<parameter name="Host_Name" type="string"/\>  

\<parameter name="Port" type="string"/\>  

\<parameter name="SID_or_DB" type="string"/\>  

\<parameter name="User_Name" type="string"/\>  

\<parameter name="Password" type="username"/\>  

\<parameter name="SQL" type="string"/\>  
\</parameters\>

At the end macro (JAR file) is added by add-on manager. When the macro is inserted to a Confluence page, Macro browser is opened to get the parameters (before preview).

The macro plugin works fine. Only problem is password field is exposed to other users also because it's not masked (what is done by a type "password" filed in html).

Is my description of the problem enough to understand?

Please reply.


author: Davin Studer
body: What macro of what add-on is this for?
SQL error ORA-01442 when perform confluence upgrade from 5.9.4 to 6.0.5
Asked by xiaobo ding:

I am trying to upgrade confluence which is data center edition from 5.9.4 to 6.0.5. I followed the guide to unzip the installation directory and modify the properties to let the new application point to the old home directory and DB. But when I tried to start the new application, system showed error message about SQL error ORA-01442.

2017-02-21 17:22:28,312 ERROR \[localhost-startStop-1\] \[atlassian.confluence.plugin.PluginFrameworkContextListener\] launchUpgrades Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.PopulateLowerFieldsUpgradeTask@3f08baa3 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; uncategorized SQLException for SQL \[alter table SPACES modify LOWERSPACEKEY nvarchar2(255) not null\]; SQL state \[72000\]; error code \[1442\]; ORA-01442: column to be modified to NOT NULL is already NOT NULL ; nested exception is java.sql.SQLException: ORA-01442: column to be modified to NOT NULL is already NOT NULL com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.PopulateLowerFieldsUpgradeTask@3f08baa3 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; uncategorized SQLException for SQL \[alter table SPACES modify LOWERSPACEKEY nvarchar2(255) not null\]; SQL state \[72000\]; error code \[1442\]; ORA-01442: column to be modified to NOT NULL is already NOT NULL

I've checked the db table SPACES and found the column LOWERSPACEKEY is not yet NOT NULL. It is very strange why the log said it was already NOT NULL.

Any guys can help?


Answers:
author: xiaobo ding
body: After I recovered the system and did the upgrade again, this issue did not appear again.

comments: author: WIKI_Queue
body: I recovered the system , run the upgrade agian, but still the same issue,

Any suggestion ?


Tags: confluence-administration
How can I query a linked JIRA database using MySQL without an addon?
Asked by Cole:

I am wanting to show query results in a confluence page and am not sure how to go about it.


Answers:
author: Nic Brough -Adaptavist-
body: Confluence doesn't have anything that can read a database built into it.

Reading a JIRA database directly is usually the worst option for reporting on JIRA data.

Confluence **does** have the JIRA macros for reading JIRA data. I'd strongly recommend using those.

comments: author: Cole
body: Well, I realize that normally it is not good to report this way, however, I am trying to pull worklog information and have not found a great way to do that other than directly from the database as I do not know how to use the REST API in the same way to make this query where I sum up users time logged for the next 30, 60, and 90 days.

```
SELECT u.display_name Associate     , SUM(CASE WHEN w.startdate BETWEEN NOW() AND NOW() + INTERVAL 30 DAY THEN w.timeworked END/3600) '30 Days'     , SUM(CASE WHEN w.startdate BETWEEN NOW() AND NOW() + INTERVAL 60 DAY THEN w.timeworked END/3600) '60 Days'     , SUM(CASE WHEN w.startdate BETWEEN NOW() AND NOW() + INTERVAL 90 DAY THEN w.timeworked END/3600) '90 Days'  FROM worklog w  JOIN cwd_user u    ON u.user_name = w.author   JOIN cwd_membership m    ON m.directory_id = u.directory_id   AND m.lower_child_name = u.lower_user_name WHERE m.membership_type = 'GROUP_USER'   AND m.lower_parent_name = 'atl_servicedesk_it_agents'   AND w.startdate BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 90 DAY) GROUP    BY u. display_name ORDER     BY u.last_name;
```


Tags: confluence-administration

database

jira

mysql

sql
Display MySQL Query Result from JIRA DB in Confluence Page?
Asked by Cole:

I am trying to display results from a MySQL query to the JIRA Database using an HTML macro. The script I put in looked like it should work, however, it doesn't show anything. The page is completely blank. What am i doing wrong?

```
&lt;script&gt;&lt;?php$con=mysqli_connect("example.com","user","pass","database");// Check connectionif (mysqli_connect_errno()){echo "Failed to connect to MySQL: " . mysqli_connect_error();}$result = mysqli_query($con,"SELECT * FROM cwd_user");echo "&lt;table border='1'&gt;&lt;tr&gt;&lt;th&gt;Firstname&lt;/th&gt;&lt;th&gt;Lastname&lt;/th&gt;&lt;/tr&gt;";while($row = mysqli_fetch_array($result)){echo "&lt;tr&gt;";echo "&lt;td&gt;" . $row['first_name'] . "&lt;/td&gt;";echo "&lt;td&gt;" . $row['last_name'] . "&lt;/td&gt;";echo "&lt;/tr&gt;";}echo "&lt;/table&gt;";mysqli_close($con);?&gt;&lt;/script&gt;
```


Answers:
author: Davin Studer
body: PHP is a server side language. HTML is client side. You can only put HTML into the HTML macro. If you want to display the results of a SQL query on a Confluence page you should look into a [SQL add-on](https://marketplace.atlassian.com/search?product=confluence&query=sql) from the marketplace. Another option would be to host your PHP elsewhere and then in the HTML macro do an AJAX call to the PHP page and insert the data into the Confluence page. Confluence has jQuery, so it wouldn't be too hard to setup the AJAX.

comments: author: Cole
body: Unfortunately, I am unable to purchase any add-ons. I will look into your other suggestion, but I am not too sure how to execute it. I wish it were easier to pull data from the JIRA database.


author: Davin Studer
body: Another option would be to implement you php page elsewhere and then iframe it into Confluence.


author: Julian Riedinger [Decadis AG]
body: Hi Cole,

as far as I know, you are not able to write php-code within a macro. Maybe you have a look on this add-on?

<https://marketplace.atlassian.com/plugins/de.scandio.confluence.plugins.pocketquery/server/pricing>

Cheers,

Julian


Tags: confluence-administration

database

jira

mysql

sql