Skip to content

Create a task on a pull request

POST
/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks

Creates a new pull request task.

Returns the newly created pull request task.

Tasks can optionally be created in relation to a comment specified by the comment’s ID which will cause the task to appear below the comment on a pull request when viewed in Bitbucket.

pull_request_id
required
integer

The id of the pull request.

repo_slug
required
string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace
required
string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

The contents of the task

Media type application/json
Pull Request Task Create

A pullrequest task create

object
content
required
Task Raw Content

Task raw content

object
raw
required

The task contents

string
comment
object
type
required
string
id
integer format: int64
created_on
string format: date-time
updated_on
string format: date-time
content
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
deleted
boolean
parent
object recursive
inline
object
from

The comment’s anchor line in the old version of the file. If the comment is a multi-line comment, this is the ending line number in the old version of the file.

integer
>= 1
to

The comment’s anchor line in the new version of the file. If the comment is a multi-line comment, this is the ending line number in the new version of the file.

integer
>= 1
start_from

The starting line number in the old version of the file, if the comment is a multi-line comment. This is null otherwise.

integer
>= 1
start_to

The starting line number in the new version of the file, if the comment is a multi-line comment. This is null otherwise.

integer
>= 1
path
required

The path of the file this comment is anchored to.

string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
code
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
pending
boolean

The newly created task.

Media type application/json
object
id
integer format: int64
created_on
required
string format: date-time
updated_on
required
string format: date-time
state
required
string
Allowed values: RESOLVED UNRESOLVED
content
required
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
creator
required
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
pending
boolean
resolved_on

The ISO8601 timestamp for when the task was resolved.

string format: date-time
resolved_by
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
comment
object
type
required
string
id
integer format: int64
created_on
string format: date-time
updated_on
string format: date-time
content
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
deleted
boolean
parent
object recursive
inline
object
from

The comment’s anchor line in the old version of the file. If the comment is a multi-line comment, this is the ending line number in the old version of the file.

integer
>= 1
to

The comment’s anchor line in the new version of the file. If the comment is a multi-line comment, this is the ending line number in the new version of the file.

integer
>= 1
start_from

The starting line number in the old version of the file, if the comment is a multi-line comment. This is null otherwise.

integer
>= 1
start_to

The starting line number in the new version of the file, if the comment is a multi-line comment. This is null otherwise.

integer
>= 1
path
required

The path of the file this comment is anchored to.

string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
code
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
Example
{
"state": "RESOLVED",
"content": {
"markup": "markdown"
},
"comment": {
"content": {
"markup": "markdown"
}
}
}
Location
string

The URL of the new task

There is a missing required field in the request or the task content is blank.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}

If the authenticated user does not have access to the pull request.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}

If the pull request does not exist.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}