Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

This document provides REST API details for Space fields plugin.


Get Space Fields

GET http://localhost:8090/rest/spacefields/1.0/utility/list/fields/space/key/{spaceKey}

GET http://localhost:8090/rest/spacefields/1.0/utility/list/fields/space/key/{spaceKey}/field/id/{fieldId}

Query Parameters:

  • spaceKey (String)
  • fieldId (Number)

Response: [Status: 200]

$ curl -u"user:pass" -XGET \
http://localhost:8090/rest/spacefields/1.0/utility/list/fields/space/key/DT/field/id/2
{"fieldId":2,"spaceKey":"DT","fieldName":"project.owner.name","fieldValue":"Venkat Prasad",\
"lastUpdated":1524976091105,"accessType":"public"}
$


Get Space Fields History

GET http://localhost:8090/rest/spacefields/1.0/utility/list/fields/space/history/id/{fieldId}

Path Parameters:

  • fieldId (Number) - Confluence Space Field ID


Add Space Field

POST http://localhost:8090/rest/spacefields/1.0/utility/add/field

Schema Fields:

  • spaceKey (String)
  • fieldName (String)
  • fieldValue (String)
  • accessType (String) - Optional
  • history (Boolean) - Optional

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldName":"project.security.key", "fieldValue":"nxoedoew","accessType":"public"}' \
http://localhost:8090/rest/spacefields/1.0/utility/add/field
{"field":5,"message":"[Info] Added Space Field"}
$


Update Space Field

POST http://localhost:8090/rest/spacefields/1.0/utility/update/field

Schema Fields:

  • spaceKey (String)
  • fieldName (String)
  • fieldValue (String)
  • accessType (String) - Optional
  • history (Boolean) - Optional

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldName":"project.security.key", "fieldValue":"xxxxxxx"}' \
http://localhost:8090/rest/spacefields/1.0/utility/update/field 
{"field":5,"message":"[Info] Updated Space Field"}
$

Note. Update creates field if not exists.


Force Update Space Field

POST http://localhost:8090/rest/spacefields/1.0/utility/update/field/force

Schema Fields:

  • spaceKey (String)
  • fieldId (Number)
  • fieldName (String)
  • fieldValue (String)
  • accessType (String) - Optional
  • history (Boolean) - Optional

Response: [Status: 200]

Note. This API helps to rename field name.

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldId":"5", "fieldName":"project.security.key", "fieldValue":"xxxxxxx"}' \
http://localhost:8090/rest/spacefields/1.0/utility/update/field 
{"field":5,"message":"[Info] Updated Space Field"}
$


Delete Space Field

DELETE http://localhost:8090/rest/spacefields/1.0/utility/remove/fields/space/key/{spaceKey}/field/id/{fieldId}

$ curl -u"user:pass" -XDELETE \
http://localhost:8090/rest/spacefields/1.0/utility/remove/fields/space/key/DT/field/id/5
{"field":5,"message":"[Info] Removed Space Field"}
$
  • No labels