Project Properties CLI - REST API
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:
- projectKey (String) - Jira Project Key
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:
- projectKey (String) - Jira Project Key
- propertyId (Number) - Property ID
Response: [Status: 200]
$ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/one?projectKey=DT&propertyId=123"
Get Projects by Property search
(Since plugin version 2.2.7)
GET http://localhost:8080/rest/projectproperties/1.0/property/projects/?propertyKeyFilter={propertyKey}&propertyValueFilter={propertyValue}
Query Parameters:
- propertyKeyFilter (String) - Property Key to search e.g. hello or %hello%
- propertyValueFilter (String) - Property value to search e.g. hello or %hello%
Response: [Status: 200]
$ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/projects/?propertyKeyFilter=hello&propertyValueFilter=%world%" $ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/projects/?propertyKeyFilter=hello" $ curl -u username -XGET "http://localhost:8080/rest/projectproperties/1.0/property/projects/?propertyValueFilter=world"
Create/Add Project Properties
POST http://localhost:8080/rest/projectproperties/1.0/property/add
Required Schema Fields:
- projectKey (String) - Jira Project Key
- propertyKey (String)
- propertyValue (String)
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:
- projectKey (String) - Jira Project Key
- propertyKey (String)
- propertyValue (String)
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:
- projectKey (String) - Jira Project Key
Required Schema Fields:
- propertyKey (String)
- propertyValue (String)
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:
- projectKey (String) - Jira Project Key
- propertyId (Number)
- propertyKey (String)
- propertyValue (String)
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/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/