Hey guys,
I'm using Jira library on python to get a pd df with the data.
I succeed to get all the fields that I want, but for some reason I get only NaN values in all of the custom fields that thier type is list (single or multipe). These fields have values in Jira..
this is my code:
from atlassian import Jira
jira_instance = Jira(
url = ''
username =''
password = ''
)
import requests
from requests.auth import HTTPBasicAuth
import json
import pandas as pd
def retrieve_all_query_results(jira_instance: Jira, query_string: str, fields: list) -> list:
issues_per_query = 100
list_of_jira_issues = []
# Get the total issues in the results set. This is one extra request but it keeps things simple.
num_issues_in_query_result_set = jira_instance.jql(query_string, limit = 0)["total"]
print(f"Query `{query_string}` returns {num_issues_in_query_result_set} issues")
# Use floor division + 1 to calculate the number of requests needed
for query_number in range(0, (num_issues_in_query_result_set // issues_per_query) + 1):
results = jira_instance.jql(query_string, limit = issues_per_query, start = query_number * issues_per_query, fields = fields)
list_of_jira_issues.extend(results["issues"])
return list_of_jira_issues
jql_result_set_issues = retrieve_all_query_results(jira_instance, "Project in (SZ)", fields = "*all")
all_data = pd.json_normalize(jql_result_set_issues)
Does anyone know why this is happening?
Thank you
Select list fields do not hold numeric data, when you get their content via a REST call, it is giving you the name of the option as a string.
You'll need to code to convert from a string to a number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.