You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/confluence-plugin/README.md
+40-13Lines changed: 40 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,42 @@ This plugin makes it possible to view Confluence assets alongside related entiti
6
6
7
7
This is a [Cortex](https://www.cortex.io/) plugin. To see how to run the plugin inside of Cortex, see [our docs](https://docs.cortex.io/docs/plugins).
8
8
9
-
### Prerequisites
9
+
##Setup
10
10
11
-
The URL of your Confluence instance should be configured in `src/components/PageContent.tsx`. To do so, change the following line to match the URL of your server:
Your Confluence instance URL should look like `https://something.atlassian.net`. We will use this URL in the plugin's proxy and in the plugin's configuration entity.
14
+
15
+
### Set your Confluence credentials
16
+
17
+
If you are using username and password authentication, type them in to a text editor with a colon (`:`) between them. If you are using SSO, use an API token in place of the password. To create an API token in Confluence, follow the [instructions provided by Atlassian](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). Once you have your text in your text editor like `[email protected]:MySecretPassWordOrToken`, you need to base64 encode it. You can do this using an online tool like [this](https://www.base64encode.org). You will add the base64 encoded value to Cortex as a secret. Copy the base64 encoded value. In Cortex, click on Settings > Secrets > Add secret. In Secret name, type `confluence_secret`, paste the base64 encoded secret into Secret value, and click on Create secret.
18
+
19
+
### Set up a Plugin Proxy
20
+
21
+
After you've saved the secret, we will set up a proxy to use that secret to communicate with Confluence. In Cortex, click on Plugins > Proxies > Create Proxy. In Name, type `Confluence Proxy`. Click on Add URL, and put in your Confluence Instance URL, like `https://something.atlassian.net`. Click Save. Next, click on "Add header to https://something.atlassian.net". In the dialog box that appears, type `Authorization` in the Name field, and in the Value field, type `Basic {{{secrets.confluence_secret}}}`. Make sure you include the three curly braces, and make sure the secret name matches the secret you created above, with `secrets.` in front of it. Click Save, then click on the Create Proxy button.
22
+
23
+
### Associate the plugin with the plugin proxy
16
24
17
-
Developing and building this plugin requires either [yarn](https://classic.yarnpkg.com/lang/en/docs/install/) or [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
25
+
Create or edit your Confluence Plugin. In the dropdown under the Associated Proxy heading, choose the Confluence proxy you created above. Next, click Save plugin at the bottom of the page.
18
26
19
-
##Getting started
27
+
### Create a plugin configuration entity
20
28
21
-
1. Modify the `src/components/PageContent.tsx` file as described above
22
-
2. Run `yarn` to download all dependencies
23
-
3. Run `yarn build` to compile the plugin code into `./dist/ui.html`
24
-
4. Upload `ui.html` into Cortex on a create or edit plugin page
25
-
5. Add or update the code and repeat steps 2-3 as necessary
29
+
- Consider creating a new entity type, so that any existing scorecards are not affected by ths configuration entity. In this example, we have created a new entity type called `plugin-configuration`
30
+
- Create a new entity with the tag `confluence-plugin-config`
31
+
- Set `x-cortex-definition.confluence-url` to the value of your Confluence Instance URL. For example, if my Confluence Instance URL was `https://martindstone.service-now.com`, my `confluence-plugin-config` entity would look like this:
Entities can be associated with Confluence Page IDs by adding a PageID tag to the `x-cortex-confluence` object. In the Entity yaml for the entity to the Page ID that you'd like to view inside of Cortex, such as:
30
47
@@ -34,3 +51,13 @@ x-cortex-confluence:
34
51
```
35
52
36
53
You can do this for Custom Entities, as well as any Service entity.
54
+
55
+
### Done!
56
+
57
+
Now when you load the Confluence plugin on an entity that has a Confluence page ID in `x-cortex-confluence.pageID`, you should see the content of that page in Cortex!
58
+
59
+
## Building the plugin
60
+
61
+
1. Run `yarn` to download all dependencies
62
+
2. Run `yarn build` to compile the plugin code into `./dist/ui.html`
63
+
3. Upload `ui.html` into Cortex on a create or edit plugin page
0 commit comments