Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

This documentation refers to Jira Data Center only.  This page contains the basic examples. To get all options please navigate to: https://developer.atlassian.com/server/jira/platform/rest/v10004/intro/#gettingstarted

Jira REST APIs

Jira has REST APIs and Java APis that you can use to interact with Jira. For example, you may want to integrate your existing application with Jira or write a script to get information from Jira. For more information, check out our reference documentation:

...

Expand
titleGet custom fields with pagination

GET /rest/api/2/customFields

Returns a list of Custom Fields in the given range.

Request

Query parameters

sortColumn

string

The column by which to sort the returned custom fields.

types

string

A list of custom field types to filter the custom fields.

search

string

A query string used to search custom fields.

maxResults

string

The maximum number of custom fields to return.

sortOrder

string

The order in which to sort the returned custom fields.

screenIds

string

A list of screen IDs to filter the custom fields.

lastValueUpdate

string

The last value update to filter the custom fields.

projectIds

string

A list of project IDs to filter the custom fields.

startAt

string

The starting index of the returned custom fields.

Example

Code Block
languagepython
# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
from requests.auth import HTTPBasicAuth
import json

url = "http://{baseurl}/rest/api/2/customFields"

auth = HTTPBasicAuth("email@example.com", "<api_token>")

headers = {
  "Accept": "application/json"
}

response = requests.request(
   "GET",
   url,
   headers=headers,
   auth=auth
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))


Expand
titleDelete custom fields in bulk

DELETE /rest/api/2/customFields

Deletes custom fields in bulk.

Request

Query parameters

ids Required

string

A list of custom field IDs to delete.

Example

Code Block
languagepython
# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
from requests.auth import HTTPBasicAuth
import json

url = "http://{baseurl}/rest/api/2/customFields"

auth = HTTPBasicAuth("email@example.com", "<api_token>")

headers = {
  "Accept": "application/json"
}

query = {
  'ids': '{ids}'
}

response = requests.request(
   "DELETE",
   url,
   headers=headers,
   params=query,
   auth=auth
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))


Expand
titleGet custom field options

Experimental

GET /rest/api/2/customFields/{customFieldId}/options

Returns custom field's options defined in a given context composed of projects and issue types.

Request

Path parameters

customFieldId Required

string

The ID of the custom field.

Query parameters

maxResults

string

The maximum number of results to return.

issueTypeIds

string

A list of issue type IDs in a context.

query

string

A string used to filter options.

sortByOptionName

string

Flag to sort options by their names.

useAllContexts

string

Flag to fetch all options regardless of context, project IDs, or issue type IDs.

page

string

The page of options to return.

projectIds

string

A list of project IDs in a context.

Example

Code Block
languagepython
# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
from requests.auth import HTTPBasicAuth
import json

url = "http://{baseurl}/rest/api/2/customFields/{customFieldId}/options"

auth = HTTPBasicAuth("email@example.com", "<api_token>")

headers = {
  "Accept": "application/json"
}

response = requests.request(
   "GET",
   url,
   headers=headers,
   auth=auth
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))


...