Hi all
This is my first time posting on this community.
I am new to APIs and so far I have managed to get my script to pull the information I need relating to a project, what I am slightly stuck over is how to return the values from custom fields within my script.
This is the script in Python
import requests
import json
import base64
# Security - Base encode email and api token
cred = "Basic " + base64.b64encode(b'***********:**************').decode("utf-8")
# Set header parameters
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization" : cred
}
# Project Key
projectKey = "AD"
# Link to my site URL
url = "https://**************/rest/api/3/search?jql=project=" + projectKey
# Request and Response
response = requests.request(
"GET",
url,
headers=headers
)
# Decode Json string to Python
json_data = json.loads(response.text)
# Display issues and selected fields
for item in json_data["issues"]:
print(item["id"] + "\t" + item["key"] + "\t" +
item["fields"]["issuetype"]["name"] + "\t" +
item["fields"]["created"]+ "\t" +
item["fields"]["creator"]["displayName"] + "\t" +
item["fields"]["status"]["name"] + "\t" +
item["fields"]["summary"] + "\t"
)
In the display issues and selected fields, how can I get it to return values from specific Custom Fields?
thanks
Gareth