Create workflow
POST
/rest/api/3/workflow
Workflows
Conditions
Always false condition
"type": "AlwaysFalseCondition"
}
Block transition until approval
"type": "BlockInProgressApprovalCondition"
}
Compare number custom field condition
"type": "CompareNumberCFCondition",
"configuration": {
"comparator": "=",
"fieldId": "customfield_10029",
"fieldValue": 2
}
}
comparator
One of the supported comparator: =
, >
, and <
.fieldId
The custom numeric field ID. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:float
com.pyxis.greenhopper.jira:jsw-story-points
fieldValue
The value for comparison.Hide from user condition
"type": "RemoteOnlyCondition"
}
Only assignee condition
"type": "AllowOnlyAssignee"
}
Only Bamboo notifications workflow condition
"type": "OnlyBambooNotificationsCondition"
}
Only reporter condition
"type": "AllowOnlyReporter"
}
Permission condition
"type": "PermissionCondition",
"configuration": {
"permissionKey": "BROWSE_PROJECTS"
}
}
permissionKey
The permission required to perform the transition. Allowed values: built-in or app defined permissions.Previous status condition
"type": "PreviousStatusCondition",
"configuration": {
"ignoreLoopTransitions": true,
"includeCurrentStatus": true,
"mostRecentStatusOnly": true,
"reverseCondition": true,
"previousStatus": {
"id": "5"
}
}
}
previousStatus
object, matches any previous issue status, unless:ignoreLoopTransitions
is true
, then loop transitions (from and to the same status) are ignored.includeCurrentStatus
is true
, then the current issue status is also checked.mostRecentStatusOnly
is true
, then only the issue's preceding status (the one immediately before the current status) is checked.reverseCondition
is true
, then the status must not be present.Separation of duties condition
"type": "SeparationOfDutiesCondition",
"configuration": {
"fromStatus": {
"id": "5"
},
"toStatus": {
"id": "6"
}
}
}
fromStatus
OPTIONAL. An object containing the ID of the source status of the transition that is blocked. If omitted any transition to toStatus
is blocked.toStatus
An object containing the ID of the target status of the transition that is blocked.Subtask blocking condition
"type": "SubTaskBlockingCondition",
"configuration": {
"statuses": [
{
"id": "1"
},
{
"id": "3"
}
]
}
}
statuses
A list of objects containing status IDs.User is in any group condition
"type": "UserInAnyGroupCondition",
"configuration": {
"groups": [
"administrators",
"atlassian-addons-admin"
]
}
}
groups
A list of group names.User is in any project role condition
"type": "InAnyProjectRoleCondition",
"configuration": {
"projectRoles": [
{
"id": "10002"
},
{
"id": "10003"
},
{
"id": "10012"
},
{
"id": "10013"
}
]
}
}
projectRoles
A list of objects containing project role IDs.User is in custom field condition
"type": "UserIsInCustomFieldCondition",
"configuration": {
"allowUserInField": false,
"fieldId": "customfield_10010"
}
}
allowUserInField
If true
only a user who is listed in fieldId
can perform the transition, otherwise, only a user who is not listed in fieldId
can perform the transition.fieldId
The ID of the field containing the list of users.User is in group condition
"type": "UserInGroupCondition",
"configuration": {
"group": "administrators"
}
}
group
The name of the group.User is in group custom field condition
"type": "InGroupCFCondition",
"configuration": {
"fieldId": "customfield_10012"
}
}
fieldId
The ID of the field. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker
com.atlassian.jira.plugin.system.customfieldtypes:grouppicker
com.atlassian.jira.plugin.system.customfieldtypes:select
com.atlassian.jira.plugin.system.customfieldtypes:multiselect
com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons
com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes
com.pyxis.greenhopper.jira:gh-epic-status
User is in project role condition
"type": "InProjectRoleCondition",
"configuration": {
"projectRole": {
"id": "10002"
}
}
}
projectRole
An object containing the ID of a project role.Value field condition
"type": "ValueFieldCondition",
"configuration": {
"fieldId": "assignee",
"fieldValue": "qm:6e1ecee6-8e64-4db6-8c85-916bb3275f51:54b56885-2bd2-4381-8239-78263442520f",
"comparisonType": "NUMBER",
"comparator": "="
}
}
fieldId
The ID of a field used in the comparison.fieldValue
The expected value of the field.comparisonType
The type of the comparison. Allowed values: STRING
, NUMBER
, DATE
, DATE_WITHOUT_TIME
, or OPTIONID
.comparator
One of the supported comparator: >
, >=
, =
, <=
, <
, !=
.STRING
, only =
and !=
are valid options.fieldValue
empty when comparison type is !=
to indicate that a value is required in the field.yyyy-MM-dd
, and for those with time as yyyy-MM-dd HH:mm
. For example, for July 16 2021 use 2021-07-16
, for 8:05 AM use 2021-07-16 08:05
, and for 4 PM: 2021-07-16 16:00
.Validators
Date field validator
"type": "DateFieldValidator",
"configuration": {
"comparator": ">",
"date1": "updated",
"date2": "created",
"expression": "1d",
"includeTime": true
}
}
comparator
One of the supported comparator: >
, >=
, =
, <=
, <
, or !=
.date1
The date field to validate. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:datepicker
com.atlassian.jira.plugin.system.customfieldtypes:datetime
com.atlassian.jpo:jpo-custom-field-baseline-end
com.atlassian.jpo:jpo-custom-field-baseline-start
duedate
created
updated
resolutiondate
date2
The second date field. Required, if expression
is not passed. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:datepicker
com.atlassian.jira.plugin.system.customfieldtypes:datetime
com.atlassian.jpo:jpo-custom-field-baseline-end
com.atlassian.jpo:jpo-custom-field-baseline-start
duedate
created
updated
resolutiondate
expression
An expression specifying an offset. Required, if date2
is not passed. Offsets are built with a number, with -
as prefix for the past, and one of these time units: d
for day, w
for week, m
for month, or y
for year. For example, -2d means two days into the past and 1w means one week into the future. The now
keyword enables a comparison with the current date.includeTime
If true
, then the time part of the data is included for the comparison. If the field doesn't have a time part, 00:00:00 is used.Windows date validator
"type": "WindowsDateValidator",
"configuration": {
"date1": "customfield_10009",
"date2": "created",
"windowsDays": 5
}
}
date1
The date field to validate. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:datepicker
com.atlassian.jira.plugin.system.customfieldtypes:datetime
com.atlassian.jpo:jpo-custom-field-baseline-end
com.atlassian.jpo:jpo-custom-field-baseline-start
duedate
created
updated
resolutiondate
date2
The reference date. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:datepicker
com.atlassian.jira.plugin.system.customfieldtypes:datetime
com.atlassian.jpo:jpo-custom-field-baseline-end
com.atlassian.jpo:jpo-custom-field-baseline-start
duedate
created
updated
resolutiondate
windowsDays
A positive integer indicating a number of days.Field required validator
"type": "FieldRequiredValidator",
"configuration": {
"ignoreContext": true,
"errorMessage": "Hey",
"fieldIds": [
"versions",
"customfield_10037",
"customfield_10003"
]
}
}
ignoreContext
If true
, then the context is ignored and all the fields are validated.errorMessage
OPTIONAL. The error message displayed when one or more fields are empty. A default error message is shown if an error message is not provided.fieldIds
The list of fields to validate.Field changed validator
"type": "FieldChangedValidator",
"configuration": {
"fieldId": "comment",
"errorMessage": "Hey",
"exemptedGroups": [
"administrators",
"atlassian-addons-admin"
]
}
}
fieldId
The ID of a field.errorMessage
OPTIONAL. The error message displayed if the field is not changed. A default error message is shown if the error message is not provided.exemptedGroups
OPTIONAL. The list of groups.Field has single value validator
"type": "FieldHasSingleValueValidator",
"configuration": {
"fieldId": "attachment,
"excludeSubtasks": true
}
}
fieldId
The ID of a field.excludeSubtasks
If true
, then values copied from subtasks are ignored.Parent status validator
"type": "ParentStatusValidator",
"configuration": {
"parentStatuses": [
{
"id":"1"
},
{
"id":"2"
}
]
}
}
parentStatus
The list of required parent issue statuses.Permission validator
"type": "PermissionValidator",
"configuration": {
"permissionKey": "ADMINISTER_PROJECTS"
}
}
permissionKey
The permission required to perform the transition. Allowed values: built-in or app defined permissions.Previous status validator
"type": "PreviousStatusValidator",
"configuration": {
"mostRecentStatusOnly": false,
"previousStatus": {
"id": "15"
}
}
}
mostRecentStatusOnly
If true
, then only the issue's preceding status (the one immediately before the current status) is checked.previousStatus
An object containing the ID of an issue status.Regular expression validator
"type": "RegexpFieldValidator",
"configuration": {
"regExp": "[0-9]",
"fieldId": "customfield_10029"
}
}
regExp
A regular expression.fieldId
The ID of a field. Allowed field types:com.atlassian.jira.plugin.system.customfieldtypes:select
com.atlassian.jira.plugin.system.customfieldtypes:multiselect
com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons
com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes
com.atlassian.jira.plugin.system.customfieldtypes:textarea
com.atlassian.jira.plugin.system.customfieldtypes:textfield
com.atlassian.jira.plugin.system.customfieldtypes:url
com.atlassian.jira.plugin.system.customfieldtypes:float
com.pyxis.greenhopper.jira:jsw-story-points
com.pyxis.greenhopper.jira:gh-epic-status
description
summary
User permission validator
"type": "UserPermissionValidator",
"configuration": {
"permissionKey": "BROWSE_PROJECTS",
"nullAllowed": false,
"username": "TestUser"
}
}
permissionKey
The permission to be validated. Allowed values: built-in or app defined permissions.nullAllowed
If true
, allows the transition when username
is empty.username
The username to validate against the permissionKey
.Post functions
Fire issue event function
"type": "FireIssueEventFunction",
"configuration": {
"event": {
"id":"1"
}
}
}
FireIssueEventFunction
. Can be included once in a transition.event
An object containing the ID of the issue event.Update issue status
"type": "UpdateIssueStatusFunction"
}
Create comment
"type": "CreateCommentFunction"
}
Store issue
"type": "IssueStoreFunction"
}
Assign to current user function
ASSIGNABLE_USER
permission."type": "AssignToCurrentUserFunction"
}
Assign to lead function
"type": "AssignToLeadFunction"
}
Assign to reporter function
"type": "AssignToReporterFunction"
}
Clear field value function
"type": "ClearFieldValuePostFunction",
"configuration": {
"fieldId": "assignee"
}
}
fieldId
The ID of the field.Copy value from other field function
"type": "CopyValueFromOtherFieldPostFunction",
"configuration": {
"sourceFieldId": "assignee",
"destinationFieldId": "creator",
"copyType": "same"
}
}
sourceFieldId
The ID of the source field.destinationFieldId
The ID of the destination field.copyType
Use same
to copy the value from a field inside the issue, or parent
to copy the value from the parent issue.Create Crucible review workflow function
"type": "CreateCrucibleReviewWorkflowFunction"
}
Set issue security level based on user's project role function
"type": "SetIssueSecurityFromRoleFunction",
"configuration": {
"projectRole": {
"id":"10002"
},
"issueSecurityLevel": {
"id":"10000"
}
}
}
projectRole
An object containing the ID of the project role.issueSecurityLevel
OPTIONAL. The object containing the ID of the security level. If not passed, then the security level is set to none
.Trigger a webhook function
"type": "TriggerWebhookFunction",
"configuration": {
"webhook": {
"id": "1"
}
}
}
webhook
An object containing the ID of the webhook listener to trigger.Update issue custom field function
"type": "UpdateIssueCustomFieldPostFunction",
"configuration": {
"mode": "append",
"fieldId": "customfield_10003",
"fieldValue": "yikes"
}
}
mode
Use replace
to override the field content with fieldValue
or append
to add fieldValue
to the end of the field content.fieldId
The ID of the field.fieldValue
The update content.Update issue field function
"type": "UpdateIssueFieldFunction",
"configuration": {
"fieldId": "assignee",
"fieldValue": "5f0c277e70b8a90025a00776"
}
}
fieldId
The ID of the field. Allowed field types:assignee
description
environment
priority
resolution
summary
timeoriginalestimate
timeestimate
timespent
fieldValue
The update value.fieldId
is assignee
, the fieldValue
should be one of these values:automatic
.unassigned
.Connect rules
"type": "appKey__moduleKey",
"configuration": {
"value":"{"isValid":"true"}"
}
}
type
A Connect rule key in a form of appKey__moduleKey
.value
The stringified JSON configuration of a Connect rule.Forge rules
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://jira.local:8080/jira/rest//rest/api/3/workflow' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "This is a workflow used for Stories and Tasks",
"name": "Workflow 1",
"statuses": [
{
"id": "1",
"properties": {
"jira.issue.editable": "false"
}
},
{
"id": "2"
},
{
"id": "3"
}
],
"transitions": [
{
"from": [],
"name": "Created",
"to": "1",
"type": "initial"
},
{
"from": [
"1"
],
"name": "In progress",
"properties": {
"custom-property": "custom-value"
},
"rules": {
"conditions": {
"conditions": [
{
"type": "RemoteOnlyCondition"
},
{
"configuration": {
"groups": [
"developers",
"qa-testers"
]
},
"type": "UserInAnyGroupCondition"
}
],
"operator": "AND"
},
"postFunctions": [
{
"type": "AssignToCurrentUserFunction"
}
]
},
"screen": {
"id": "10001"
},
"to": "2",
"type": "directed"
},
{
"name": "Completed",
"rules": {
"postFunctions": [
{
"configuration": {
"fieldId": "assignee"
},
"type": "ClearFieldValuePostFunction"
}
],
"validators": [
{
"configuration": {
"parentStatuses": [
{
"id": "3"
}
]
},
"type": "ParentStatusValidator"
},
{
"configuration": {
"permissionKey": "ADMINISTER_PROJECTS"
},
"type": "PermissionValidator"
}
]
},
"to": "3",
"type": "global"
}
]
}'
Response Response Example
201 - Success
{
"name": "Workflow 1",
"entityId": "53945d2e-4863-4409-a11c-cf4c1845ec84"
}
Request
Body Params application/json
Responses
Modified at 2023-07-13 03:27:27