Class: WorkflowSchemeClient

WorkflowSchemeClient

Constructor

new WorkflowSchemeClient(jiraClient)

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

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

createDraft(opts, callback)

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

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the draft has been created.

Source:

createWorkflowScheme(opts, callback)

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 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

Called when the workflow scheme has been created.

Source:

deleteDraft(opts, callback)

Delete the passed draft workflow scheme.

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the draft has been deleted.

Source:

deleteDraftWorkflow(opts, callback)

Delete the passed workflow from the workflow draft scheme.

Parameters:
Name Type 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

Called when the workflow has been edited.

Source:

deleteWorkflow(opts, callback)

Delete the passed workflow from the workflow scheme.

Parameters:
Name Type 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

Called when the workflow has been edited.

Source:

deleteWorkflowScheme(opts, callback)

Delete the passed workflow scheme.

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the workflow scheme has been deleted.

Source:

editDraft(opts, callback)

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 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

Called when the draft has been edited.

Source:

editDraftIssueType(opts, callback)

Set the issue type mapping for the passed draft scheme.

Parameters:
Name Type 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

Called when the issue type has been edited

Source:

editDraftWorkflow(opts, callback)

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 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

Called when the workflow has been edited.

Source:

editIssueType(opts, callback)

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 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

Called when the issue type has been edited

Source:

editWorkflow(opts, callback)

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 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

Called when the workflow has been edited.

Source:

editWorkflowScheme(opts, callback)

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 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

Called when the workflow scheme has been edited.

Source:

getDefaultWorkflow(opts, callback)

Get the default workflow from the passed workflow scheme.

Parameters:
Name Type 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

Called when the default workflow is returned.

Source:

getDraft(opts, callback)

Get the requested draft workflow scheme

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the draft has been retrieved.

Source:

getDraftDefaultWorkflow(opts, callback)

Get the default workflow from the passed draft workflow scheme

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the default workflow is returned.

Source:

getDraftIssueType(opts, callback)

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

Parameters:
Name Type 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

Called when the issue type has been retrieved.

Source:

getDraftWorkflow(opts, callback)

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

Parameters:
Name Type 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

Called when the workflow has been retrieved.

Source:

getIssueType(opts, callback)

Returns the issue type mapping for the passed workflow scheme.

Parameters:
Name Type 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

Called when the issue type has been retrieved.

Source:

getWorkflow(opts, callback)

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

Parameters:
Name Type 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

Called when the workflow has been retrieved.

Source:

getWorkflowScheme(opts, callback)

Get the requested workflow scheme

Parameters:
Name Type 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

Called when the workflow scheme has been retrieved.

Source:

removeDefaultWorkflow(opts, callback)

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type 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

Called when the defaul workflow has been removed.

Source:

removeDraftDefaultWorkflow(opts, callback)

Remove the default workflow from the passed draft workflow scheme.

Parameters:
Name Type Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
workflowSchemeId

The id of the workflow scheme.

callback

Called when the defaul workflow has been removed.

Source:

removeDraftIssueType(opts, callback)

Remove the specified issue type mapping from the scheme.

Parameters:
Name Type 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

Called when the issue type mapping has been removed.

Source:

removeIssueType(opts, callback)

Remove the specified issue type mapping from the scheme.

Parameters:
Name Type 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

Called when the issue type mapping has been removed.

Source:

setDefaultWorkflow(opts, callback)

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type 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

Called when the default workflow has been updated.

Source:

setDraftDefaultWorkflow(opts, callback)

Remove the default workflow from the passed workflow scheme.

Parameters:
Name Type 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

Called when the default workflow has been updated.

Source: