JMWE REST API Details

REST API endpoints exist for several types of extensions, including Shared Actions, Shared Conditions, and Shared Validators, as well as Event-based and Scheduled Actions.

Shared action REST API details

Rest API URL

Method

Description

Rest API URL

Method

Description

1

/rest/jmwe/1/shared-actions

PUT

Creates a Shared Action (or draft Shared Action). See API Payload Structure, below.

2

/rest/jmwe/1/shared-actions

GET

Returns a list of all Shared Actions.

3

/rest/jmwe/1/shared-actions/{id}

PUT

Promotes an existing draft of the Shared Action with the specified ID, making it the active configuration.

4

/rest/jmwe/1/shared-actions/{id}

GET

Returns the configuration of the Shared Action with the specified ID.

5

/rest/jmwe/1/shared-actions/{id}

DELETE

Delete the Shared Action with the specified ID.

6

/rest/jmwe/1/shared-actions/{id}?draft=true

GET

Returns the configuration of the draft Shared Action with the specified ID.

7

/rest/jmwe/1/shared-actions/{id}/copy

POST

Duplicate the Shared Action with the specified ID.

Shared condition REST API details

Rest API URL

Method

Description

Rest API URL

Method

Description

1

/rest/jmwe/1/shared-conditions

PUT

Creates a Shared Condition (or draft Shared Condition). See API Payload Structure, below.

2

/rest/jmwe/1/shared-conditions

GET

Returns a list of all Shared Condition.

3

/rest/jmwe/1/shared-conditions/{id}

PUT

Promotes an existing draft of the Shared Condition with the specified ID, making it the active configuration.

4

/rest/jmwe/1/shared-conditions/{id}

GET

Returns the configuration of the Shared Condition with the specified ID.

5

/rest/jmwe/1/shared-conditions/{id}

DELETE

Delete the Shared Condition with the specified ID.

6

/rest/jmwe/1/shared-conditions/{id}/copy

POST

Duplicate the Shared Condition with the specified ID.

Shared validator REST API details

Rest API URL

Method

Description

Rest API URL

Method

Description

1

/rest/jmwe/1/shared-validators

PUT

Creates a Shared Validator (or draft Shared Validator). See API Payload Structure, below.

2

/rest/jmwe/1/shared-validators

GET

Returns a list of all Shared Validators.

3

/rest/jmwe/1/shared-validators/{id}

PUT

Promotes an existing draft of the Shared Validator with the specified ID, making it the active configuration.

4

/rest/jmwe/1/shared-validators/{id}

GET

Returns the configuration of the Shared Validator with the specified ID.

5

/rest/jmwe/1/shared-validators/{id}

DELETE

Delete the Shared Validator with the specified ID.

6

/rest/jmwe/1/shared-validators/{id}/copy

POST

Duplicate the Shared Validator with the specified ID.

Event-based action REST API details

Please note: the parameter values for creating an Event-based Action can be complicated; there are numerous options, with dynamic option values that are dependent on configurations of controlling parameters. For this reason, it is highly recommended that you create a sample Event-based action and examine the configuration of that extension using the REST API endpoint. Future extensions can be configured using that baseline.

Rest API URL

Method

Description

Rest API URL

Method

Description

1

/rest/jmwe/1/event-actions

PUT

Create an Event-based Action (or draft Event-based Action). See API Payload Structure, below.

2

/rest/jmwe/1/event-actions

GET

Returns a list of all Event-based Actions.

3

/rest/jmwe/1/event-actions/{id}

PUT

Promotes an existing draft of the Event-based Action with the specified ID, making it the active configuration.

4

/rest/jmwe/1/event-actions/{id}

GET

Returns the configuration of the Event-based Action with the specified ID

5

/rest/jmwe/1/event-actions/{id}

DELETE

Delete the Event-based Action with the specified ID.

6

/rest/jmwe/1/event-actions/{id}?draft=true

GET

Returns the configuration of a draft Event-based Action with the specified ID.

7

/rest/jmwe/1/event-actions/{id}/copy

POST

Duplicate the Event-based Action with the specified ID.

8

/rest/jmwe/1/event-actions/{actionId}/toggle

POST

Toggle the status of the Event-based Action between Enabled and Disabled; if the Event-based Action is currently enabled, it will be disabled, and vice versa.

Scheduled Action Rest API details

Rest API URL

Method

Description

Rest API URL

Method

Description

1

/rest/jmwe/1/scheduled-actions

PUT

Create a Schedule Action (or draft Scheduled Action). See API Payload Structure, below.

2

/rest/jmwe/1/scheduled-actions

GET

Returns a list of Scheduled Actions.

3

/rest/jmwe/1/scheduled-actions/{id}

DELETE

Delete the Scheduled Action with the specified ID.

4

/rest/jmwe/1/scheduled-actions/{id}/toggle

PUT

Toggle the status of the Scheduled Action between Enabled and Disabled; if the Scheduled Action is currently enabled, it will be disabled, and vice versa.

5

/rest/jmwe/1/scheduled-actions/{id}

GET

Returns the configuration of the Scheduled Action with the specified ID.

6

/rest/jmwe/1/scheduled-actions/{id}/run

GET

Manually run the Scheduled Action.

7

/rest/jmwe/1/scheduled-actions/status

GET

Fetch the last run and next run data for all Scheduled Actions.

8

/rest/jmwe/1/scheduled-actions/{id}?draft=true

GET

Returns the configuration of the draft Scheduled Action with the specified ID.

API payload structure

Below are two examples of the API payload for creating an extension.

Create Shared Action

{ "name": "Example action", "description": "Test", "postFunctions": [ { "pluginModuleKey": "com.innovalog.jmwe.jira-misc-workflow-extensions:assigntorolemember", "configuration": "<function type=\"class\">\n <arg name=\"groovyExpression\"></arg>\n <arg name=\"forceSelectedUser\">no</arg>\n <arg name=\"jira.projectrole.id\">10002</arg>\n <arg name=\"full.module.key\">com.innovalog.jmwe.jira-misc-workflow-extensionsassigntorolemember</arg>\n <arg name=\"throwExceptions\">false</arg>\n <arg name=\"class.name\">com.innovalog.jmwe.plugins.functions.AssignToRoleMemberFunction</arg>\n <arg name=\"extensionId\">14240cab-d226-4855-b3ac-a27b26b921d3</arg>\n <arg name=\"useSelectedUser\">no</arg>\n <arg name=\"useGroovyCondition\">false</arg>\n <arg name=\"skipIfAssignee\">no</arg>\n</function>\n", "order": 0 } ] }

The fields in the above example are:

  • name - Required. This value must be unique.

  • description

  • postFunctions - An array of objects containing fields using a similar module.

    • pluginModuleKey - Fully qualified module key.

    • configuration - XML string containing the configuration for the extension.

    • order - The order of the extension.

Create Draft Shared Action

{ "draft": true, "draftId": "aa5b2c0e-3f2f-4126-95d7-1f66bf694367", "name": "Draft creation example", "description": "Test - edited", "postFunctions": [ { "pluginModuleKey": "com.innovalog.jmwe.jira-misc-workflow-extensions:assigntorolemember", "configuration": "<function type=\"class\">\n <arg name=\"groovyExpression\"></arg>\n <arg name=\"forceSelectedUser\">no</arg>\n <arg name=\"jira.projectrole.id\">10002</arg>\n <arg name=\"full.module.key\">com.innovalog.jmwe.jira-misc-workflow-extensionsassigntorolemember</arg>\n <arg name=\"throwExceptions\">false</arg>\n <arg name=\"class.name\">com.innovalog.jmwe.plugins.functions.AssignToRoleMemberFunction</arg>\n <arg name=\"extensionId\">14240cab-d226-4855-b3ac-a27b26b921d3</arg>\n <arg name=\"useSelectedUser\">no</arg>\n <arg name=\"useGroovyCondition\">false</arg>\n <arg name=\"skipIfAssignee\">no</arg>\n</function>\n", "order": 0 } ] }

The fields in the above example are:

  • draft - True/False. Designation for draft status of the extension.

  • draftId - Unique ID of the draft extension.

  • name - Required. This value must be unique.

  • description

  • postFunctions - An array of objects containing fields using a similar module.

    • pluginModuleKey - Fully qualified module key.

    • configuration - XML string containing the configuration for the extension.

    • order - The order of the extension.