Class: WorkflowSchemeClient

WorkflowSchemeClient(jiraClient)

new WorkflowSchemeClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/workflowscheme'

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

createDraft(opts, callbackopt) → {Promise}

Create a draft for the passed scheme. The draft will be a copy of the state of the parent.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the draft has been created.

Source:
Returns:

Resolved when the draft has been created.

Type
Promise

createWorkflowScheme(opts, callbackopt) → {Promise}

Create a new workflow scheme. The body contains a representation of the new scheme. Values not passed are assumed to be set to their defaults.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowScheme

See https://docs.atlassian.com/jira/REST/latest/#d2e2196

callback <optional>

Called when the workflow scheme has been created.

Source:
Returns:

Resolved when the workflow scheme has been created.

Type
Promise

deleteDraft(opts, callbackopt) → {Promise}

Delete the passed draft workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the draft has been deleted.

Source:
Returns:

Resolved when the draft has been deleted.

Type
Promise

deleteDraftWorkflow(opts, callbackopt) → {Promise}

Delete the passed workflow from the workflow draft scheme.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId number

The id of the workflow scheme.

workflowName string

The name of the workflow.

callback <optional>

Called when the workflow has been edited.

Source:
Returns:

Resolved when the workflow has been edited.

Type
Promise

deleteWorkflow(opts, callbackopt) → {Promise}

Delete the passed workflow from the workflow scheme.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId number

The id of the workflow scheme.

workflowName string

The name of the workflow.

callback <optional>

Called when the workflow has been edited.

Source:
Returns:

Resolved when the workflow has been edited.

Type
Promise

deleteWorkflowScheme(opts, callbackopt) → {Promise}

Delete the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the workflow scheme has been deleted.

Source:
Returns:

Resolved when the workflow scheme has been deleted.

Type
Promise

editDraft(opts, callbackopt) → {Promise}

Update a draft workflow scheme. The draft will created if necessary. The body is a representation of the workflow scheme. Values not passed are assumed to indicate no change for that field.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

draft

See https://docs.atlassian.com/jira/REST/latest/#d2e2575

callback <optional>

Called when the draft has been edited.

Source:
Returns:

Resolved when the draft has been edited.

Type
Promise

editDraftIssueType(opts, callbackopt) → {Promise}

Set the issue type mapping for the passed draft scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

workflow

The new workflow

callback <optional>

Called when the issue type has been edited

Source:
Returns:

Resolved when the issue type has been edited

Type
Promise

editDraftWorkflow(opts, callbackopt) → {Promise}

Update the draft scheme to include the passed mapping. The body is a representation of the workflow mapping. Values not passed are assumed to indicate no change for that field.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId number

The id of the workflow scheme.

workflowName string

The name of the workflow.

issueTypes Array

The new issue types to inclue in the workflow. See https://docs.atlassian.com/jira/REST/latest/#d2e2670

callback <optional>

Called when the workflow has been edited.

Source:
Returns:

Resolved when the workflow has been edited.

Type
Promise

editIssueType(opts, callbackopt) → {Promise}

Set the issue type mapping for the passed scheme. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created/updated when the actual scheme cannot be edited.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

workflow

The new workflow

updateDraftIfNeeded

when true will create and return a draft when the workflow scheme cannot be edited (e.g. when it is being used by a project).

callback <optional>

Called when the issue type has been edited

Source:
Returns:

Resolved when the issue type has been edited

Type
Promise

editWorkflow(opts, callbackopt) → {Promise}

Update the scheme to include the passed mapping. The body is a representation of the workflow mapping. Values not passed are assumed to indicate no change for that field.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId number

The id of the workflow scheme.

workflowName string

The name of the workflow.

issueTypes Array

The new issue types to inclue in the workflow. See https://docs.atlassian.com/jira/REST/latest/#d2e2509

callback <optional>

Called when the workflow has been edited.

Source:
Returns:

Resolved when the workflow has been edited.

Type
Promise

editWorkflowScheme(opts, callbackopt) → {Promise}

Update the passed workflow scheme. The body of the request is a representation of the workflow scheme. Values not passed are assumed to indicate no change for that field. The passed representation can have its updateDraftIfNeeded flag set to true to indicate that the draft should be created and/or updated when the actual scheme cannot be edited (e.g. when the scheme is being used by a project). Values not appearing the body will not be touched.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

workflowScheme

See https://docs.atlassian.com/jira/REST/latest/#d2e2305

callback <optional>

Called when the workflow scheme has been edited.

Source:
Returns:

Resolved when the workflow scheme has been edited.

Type
Promise

getDefaultWorkflow(opts, callbackopt) → {Promise}

Get the default workflow from the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

returnDraftIfExists

when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.

callback <optional>

Called when the default workflow is returned.

Source:
Returns:

Resolved when the default workflow is returned.

Type
Promise

getDraft(opts, callbackopt) → {Promise}

Get the requested draft workflow scheme

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the draft has been retrieved.

Source:
Returns:

Resolved when the draft has been retrieved.

Type
Promise

getDraftDefaultWorkflow(opts, callbackopt) → {Promise}

Get the default workflow from the passed draft workflow scheme

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the default workflow is returned.

Source:
Returns:

Resolved when the default workflow is returned.

Type
Promise

getDraftIssueType(opts, callbackopt) → {Promise}

Returns the issue type mapping for the passed draft workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

callback <optional>

Called when the issue type has been retrieved.

Source:
Returns:

Resolved when the issue type has been retrieved.

Type
Promise

getDraftWorkflow(opts, callbackopt) → {Promise}

Returns the workflow mappings or requested mapping to the caller for the passed draft scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

workflowName

The name of the workflow.

callback <optional>

Called when the workflow has been retrieved.

Source:
Returns:

Resolved when the workflow has been retrieved.

Type
Promise

getIssueType(opts, callbackopt) → {Promise}

Returns the issue type mapping for the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

returnDraftIfExists

when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.

callback <optional>

Called when the issue type has been retrieved.

Source:
Returns:

Resolved when the issue type has been retrieved.

Type
Promise

getWorkflow(opts, callbackopt) → {Promise}

Returns the workflow mappings or requested mapping to the caller for the passed scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

workflowName

The name of the workflow.

callback <optional>

Called when the workflow has been retrieved.

Source:
Returns:

Resolved when the workflow has been retrieved.

Type
Promise

getWorkflowScheme(opts, callbackopt) → {Promise}

Get the requested workflow scheme

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Attributes Default Description
workflowSchemeId

The id of the workflow scheme.

returnDraftIfExists <optional>
false

when true indicates that a scheme's draft, if it exists, should be queried instead of the scheme itself.

callback <optional>

Called when the workflow scheme has been retrieved.

Source:
Returns:

Resolved when the workflow scheme has been retrieved.

Type
Promise

removeDefaultWorkflow(opts, callbackopt) → {Promise}

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

updateDraftIfNeeded

when true will create and return a draft when the workflow scheme cannot be edited (e.g. when it is being used by a project).

callback <optional>

Called when the defaul workflow has been removed.

Source:
Returns:

Resolved when the defaul workflow has been removed.

Type
Promise

removeDraftDefaultWorkflow(opts, callbackopt) → {Promise}

Remove the default workflow from the passed draft workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback <optional>

Called when the defaul workflow has been removed.

Source:
Returns:

Resolved when the defaul workflow has been removed.

Type
Promise

removeDraftIssueType(opts, callbackopt) → {Promise}

Remove the specified issue type mapping from the scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

callback <optional>

Called when the issue type mapping has been removed.

Source:
Returns:

Resolved when the issue type mapping has been removed.

Type
Promise

removeIssueType(opts, callbackopt) → {Promise}

Remove the specified issue type mapping from the scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

issueType

The issue type

callback <optional>

Called when the issue type mapping has been removed.

Source:
Returns:

Resolved when the issue type mapping has been removed.

Type
Promise

setDefaultWorkflow(opts, callbackopt) → {Promise}

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

workflowName

The name of the new deafault workflow

updateDraftIfNeeded

when true will create and return a draft when the workflow scheme cannot be edited (e.g. when it is being used by a project).

callback <optional>

Called when the default workflow has been updated.

Source:
Returns:

Resolved when the default workflow has been updated.

Type
Promise

setDraftDefaultWorkflow(opts, callbackopt) → {Promise}

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

workflowName

The name of the new default workflow

callback <optional>

Called when the default workflow has been updated.

Source:
Returns:

Resolved when the default workflow has been updated.

Type
Promise