Project Properties App provides REST APIs with CLI, Python and Groovy examples:


Get Project Properties

GET http://localhost:8080/rest/projectproperties/1.0/property/list/?projectKey={projectKey}

GET http://localhost:8080/rest/projectproperties/1.0/property/list/{projectKey}

Query Parameters:

Response: [Status: 200]

$ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/list?projectKey=DT"


Get Project Property

GET http://localhost:8080/rest/projectproperties/1.0/property/one/?projectKey={projectKey}&propertyId={propertyId}

GET http://localhost:8080/rest/projectproperties/1.0/property/list/{projectKey}/id/{propertyId}

Query Parameters:

Response: [Status: 200]

$ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/one?projectKey=DT&propertyId=123"


Create/Add Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/add

Required Schema Fields:

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"projectKey":"DT", \
"propertyKey":"project.security", "propertyValue":"nxoedoew"}' \
http://localhost:8080/rest/projectproperties/1.0/property/add
{"property":5,"message":"[Info] Added Property."}
$


Update Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/update

Required Schema Fields:

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"projectKey":"DT", \
"propertyKey":"project.security", "propertyValue":"xxxxxxx"}' \
http://localhost:8080/rest/projectproperties/1.0/property/update
{"property":5,"message":"[Info] Updated Property."}
$

Note. Update creates property if not exists.


Batch Or Bulk Update Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/update/bulk/{projectKey}

Required Parameters:

Required Schema Fields:

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '[ {"propertyKey":"project.name", \
"propertyValue":"Hello World"}, {"propertyKey":"project.description", "propertyValue":"Hello World Project"} ]' \
http://localhost:8080/rest/projectproperties/1.0/property/update/bulk/DT
{"property":5,"message":"[Info] Updated Properties - 5"}
$

Note. Update creates properties if not exists.


Force Update Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/update/force

Note. This API helps to rename property key.

Required Schema Fields:

Response: [Status: 200]

$ curl -u"user:pass" -XPOST  -H "Content-Type: application/json" --data '{"projectKey":"DT", \
"propertyId":"5", "propertyKey":"project.security.x", "propertyValue":"xxxxxxx"}' \
http://localhost:8080/rest/projectproperties/1.0/property/update/force
{"property":3,"message":"[Info] Updated Property."}
$


Clone Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/clone/?projectKey={projectKey}&cloneProjectKey={projectKey}

Move Project Properties

POST http://localhost:8080/rest/projectproperties/1.0/property/move/?projectKey={projectKey}&moveProjectKey={propertyId}

Delete Project Properties

DELETE http://localhost:8080/rest/projectproperties/1.0/property/remove/?projectKey={projectKey}&propertyId={propertyId}

DELETE http://localhost:8080/rest/projectproperties/1.0/property/remove/bulk/{projectKey}

curl -u"user:pass" -XDELETE "http://localhost:8080/rest/projectproperties/1.0/property/remove/?projectKey=DT&propertyId=5"


Groovy Examples

https://bitbucket.org/scmenthusiast/scmenthusiast-utilities/src/master/project-properties/groovy/


Python Examples

https://bitbucket.org/scmenthusiast/scmenthusiast-utilities/src/master/project-properties/python/