その json データでは、 issues キーが重複するため、どんどん上書きされていって最後の issues のみ残ってしまいます。
そこを改良してください。
ここから追記です。
filename : tera.json
json
1{
2 "expand": "schemanames",
3 "startAt": 0,
4 "maxResults": 100,
5 "total": 150,
6 "issues": [
7 {
8 "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
9 "id": "111111",
10 "self": "https://sample.jp//api/2/project/111111'",
11 "key": "911",
12 "fields": {
13 "parent": {
14 "id": "54321",
15 "key": "11",
16 "self": "https://sample.jp//api/2/project/11112'"
17 }
18 }
19 },
20 {
21 "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
22 "id": "111112",
23 "self": "https://sample.jp//api/2/project/111111'",
24 "key": "912",
25 "fields": {
26 "parent": {
27 "id": "54322",
28 "key": "12",
29 "self": "https://sample.jp//api/2/project/11112'"
30 }
31 }
32 }
33 ],
34 "issues2": [
35 {
36 "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
37 "id": "222222",
38 "self": "https://sample.jp//api/2/project/222222'",
39 "key": "912",
40 "fields": {
41 "parent": {
42 "id": "64320",
43 "key": "21",
44 "self": "https://sample.jp//api/2/project/11142'"
45 }
46 }
47 },
48 {
49 "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
50 "id": "3333",
51 "self": "https://sample.jp//api/2/project/222222'",
52 "key": "913",
53 "fields": {
54 "parent": {
55 "id": "54321",
56 "key": "22",
57 "self": "https://sample.jp//api/2/project/11142'"
58 }
59 }
60 }
61
62 ]
63}
64
こんな構造のjsonだったとしたら
python
1import pandas as pd
2from pandas.io.json import json_normalize
3import openpyxl
4
5f= open("tera.json", "r")
6data = json.load(f)
7
8with pd.ExcelWriter("test.xlsx") as writer:
9 for v in data:
10 if "issues" in v:
11 r = json_normalize(data[v])
12 r.to_excel(writer, sheet_name=v)
これで大体やりたいことはできるかと思います。
jsonを修正したところとしては、issues のキー名を重複しないように変更したことです。
もっと構造を変えてもよければ、issues自体をリスト化することです。
そうするともう少しスマートになるかと。