How to add custom properties to a Confluence space

Eric Collins
Contributor
December 22, 2023

Does anyone have an example of adding a custom space property from ScriptRunner for Confluence console or a listener?

1 answer

1 accepted

0 votes
Answer accepted
Eric Collins
Contributor
January 29, 2024

From Adaptavist:

  1. For storing a value in Space Properties, you can send a POST request to the below endpoint with a body request:
    Endpoint:
    <base_url>/rest/api/space/<space_key>/property
    

    Body Request:

    {
      "key": "test.post.spaceProperties",
      "value": {
        "pass": "propertiesHere"
      }
    }
    
  2. To get back the values, you can run a GET request to the below endpoint:
    http://localhost:8090/c7200/rest/api/space/PTC/property/{key-value}
    

     Replace key-value with the key you have set previously, 'test.post.spaceProperties'

You can find the library script on how to run a POST and GET request below library scripts:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events