Shared Groovy scripts REST API
- Daniel Barrow
This document details the Shared Groovy Scripts REST API of JMWE using which you can import and export shared Groovy scripts within or across Jira instances.
Resources
Returns the JSON of the shared script by the script name.
Request
URL PARAMETERS
parameter | description |
---|
parameter | description |
---|---|
| Name of the Shared Groovy script |
| Jira base URL. For example http://localhost:8080 |
Responses
STATUS 200 - application/json Returned if the shared script is found.
STATUS 401 - Unauthorized
STATUS 404 - Not found
EXAMPLE
GET http://localhost:8080/rest/jmwe/1/shared-scripts/GreetMe
Response
{
"id": "GreetMe",
"key": "GreetMe",
"code": "class GreetMe{\r\n String aString = \"Hello\"\r\n String sayIt() {\r\n return aString;\r\n\t} \r\n}",
"description": "",
"modified": 1575641794486
}
Returns the JSON of all the shared scripts in the instance
Request
URL PARAMETERS
parameter | description |
---|
parameter | description |
---|---|
| Jira base URL. For example http://localhost:8080 |
Responses
STATUS 200 - application/json Returned if the shared scripts are found.
STATUS 401 - Unauthorized
STATUS 404 - Not found
EXAMPLE
GET https://localhost:8080/rest/jmwe/1/shared-scripts
Response:
Â
Deletes the specified shared script
Request
URL PARAMETERS
parameter | description |
---|
parameter | description |
---|---|
| Name of the Shared Groovy script |
| Jira base URL. For example http://localhost:8080 |
Responses
STATUS 200 - application/json Returned if the shared scripts is deleted.
EXAMPLE
Â
Creates a new shared script
Request
URL PARAMETERS
parameter | description |
---|
parameter | description |
---|---|
| Jira base URL. For example http://localhost:8080 |
Body
Responses
STATUS 201 - application/json Returned if the shared script is created.
EXAMPLE
Body
Response
Updates the specified shared script
Request
URL PARAMETERS
parameter | description |
---|
parameter | description |
---|---|
| Name of the Shared Groovy script |
| Jira base URL. For example http://localhost:8080 |
Body
Responses
STATUS 200 - application/json Returned if the shared script is successfully updated.
EXAMPLE
Body
Response