-
Notifications
You must be signed in to change notification settings - Fork 5
JIRA v6.4
Jira's Basic Authentication involves sending Base64 encoded string of form username:password
We need to create a http-header named Authorization
of following form
"Authorzation: Basic [(BASE 64 encoded value of)username:password]"
base64 encode:
echo -n 'username:password' | base64
base64 decode:
echo 'c3VwZXJtYW46c3VwZXJwb3dlcg==' | base64 -D
Following are examples of some APIs which work without Authentication
HTTP Method | URL |
---|---|
GET | https://[jira-url]/rest/api/2/dashboard |
GET | https://[jira-url]/rest/api/latest/issue/Jira-1234?expand=names,renderedFields |
GET | https://[jira-url]/rest/menu/latest/appswitcher |
Following API can be used to fetch workflow details of a Jira project.
HTTP Method | URL | Auth |
---|---|---|
GET | https://[jira-url]/api/2/project/{projectIdOrKey}/statuses |
Is required |
For all the JIRA calls Postman was used and Basic Auth was used in the header of the call.
JIRA 6.4 REST API Documentation
HTTP Method | URL |
---|---|
GET | https://<jira.local>/rest/api/2/search?jql=<string>&maxResults=<integer>&startAt=<integer>&fields=<string>,<string>&expand=<string>,<string> |
POST |
https://<jira.local>/rest/api/2/search BODY { "jql":"<string>","maxResults":<integer>,"startAt:<integer>,"expand":["<string>"],"fields":["<string>"]}
|
Parameter | Description |
---|---|
jql=<urlEncode string> |
JIRA's JQL to send to the endpoint |
maxResults=<number> |
Number of results to return for each call. Defalut 50 max 1000 |
expand=<string>,<string>,... |
options to choose from are: operations,editmeta,changelog,transitions,renderedFields
|
fields=<string>,<string>... |
fields to return from the api call (e.g. fields=summary,labels,project,issuetype ) |
To get the history of workflow status changes make sure to add the parameter of expand=changelog
to the REST api call.
Field | JIRA Field |
---|---|
key | issues[].key |
title | issues[].fields.parent.fields.summary |
workType | issues[].fields.issuetype.name |
project | issues[].fields.labels[] |
service | issues[].fields.project.name |
classOfService | issues[].fields.labels[] |
statuses[] |
GIVEN: issues[].changelog.histories[].items[]field === "status" THEN: [ { created: issues[].changelog.histories[].created, fromStatus: issues[].changelog.histories[].items[].fromString, toStatus: issues[].changelog.histories[].items[].toString }, ... ]
|
dueDate | issues[].fields.duedate |