Passion/Python

JIRA Project List 조회

sunshout 2019. 6. 4. 15:58

https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get

 

The Jira Cloud platform REST API

The searcher defines the way the field is searched in Jira. For example, com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher. The search UI (basic search and JQL search) will display different operations and values for the field, based on

developer.atlassian.com

여기에 나와 있는 예제는 잘못 작성되어 있음

 

아래와 같은 방식으로 해야 함

 

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

url = "https://pyengine.atlassian.net/rest/api/3/project"

auth = HTTPBasicAuth("choonho.son@gmail.com", "UPDATE_MY_TOKEN_XXX")

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=(",", ": ")))